mirror of
https://github.com/YunoHost-Apps/shellinabox_ynh.git
synced 2024-09-03 20:26:12 +02:00
25 lines
627 B
Text
25 lines
627 B
Text
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
# Retrieve arguments
|
||
|
domain=$(sudo yunohost app setting shellinabox domain)
|
||
|
path=$(sudo yunohost app setting shellinabox path)
|
||
|
|
||
|
# Remove trailing "/" for next commands
|
||
|
if [[ ! "$path" == "/" ]]; then
|
||
|
path=${path%/}
|
||
|
fi
|
||
|
|
||
|
sudo apt-get update -qq
|
||
|
sudo apt-get install shellinabox -y -qq
|
||
|
|
||
|
# Copy shellinabox default configuration and restart
|
||
|
sudo cp ../conf/shellinabox /etc/default/shellinabox
|
||
|
sudo service shellinabox restart
|
||
|
|
||
|
# Configure Nginx and reload
|
||
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
||
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/shellinabox.conf
|
||
|
sudo service nginx reload
|