2015-05-08 12:03:12 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-04-20 19:34:26 +02:00
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
|
|
set -u
|
|
|
|
|
|
|
|
# Source app helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
# Get multi-instances specific variables
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2015-05-08 12:03:12 +02:00
|
|
|
|
|
|
|
# Retrieve arguments
|
2017-04-20 19:34:26 +02:00
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
path=$(ynh_app_setting_get "$app" path)
|
2015-05-08 12:03:12 +02:00
|
|
|
|
|
|
|
# Stop and remove shellinabox
|
2017-04-20 19:34:26 +02:00
|
|
|
sudo systemctl stop shellinabox || echo "ShellInABox already stopped"
|
2015-05-08 12:10:37 +02:00
|
|
|
sudo apt-get remove --purge -y -qq shellinabox || echo "ShellInABox already uninstalled"
|
|
|
|
|
2015-05-08 12:13:03 +02:00
|
|
|
# Remove service
|
|
|
|
sudo yunohost service remove shellinabox
|
|
|
|
|
2017-04-20 19:34:26 +02:00
|
|
|
# Remove Shell In A Box configuration
|
|
|
|
sudo rm -f "/etc/default/${app}"
|
2015-05-08 12:03:12 +02:00
|
|
|
# Remove Nginx proxy configuration
|
2017-04-20 19:34:26 +02:00
|
|
|
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
2015-05-08 12:03:12 +02:00
|
|
|
|
2016-05-04 14:17:07 +02:00
|
|
|
# Restart nginx
|
2017-04-20 19:34:26 +02:00
|
|
|
sudo systemctl reload nginx
|