1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shellinabox_ynh.git synced 2024-09-03 20:26:12 +02:00
shellinabox_ynh/scripts/remove
2017-04-20 19:34:26 +02:00

29 lines
792 B
Bash

#!/bin/bash
# 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
# Retrieve arguments
domain=$(ynh_app_setting_get "$app" domain)
path=$(ynh_app_setting_get "$app" path)
# Stop and remove shellinabox
sudo systemctl stop shellinabox || echo "ShellInABox already stopped"
sudo apt-get remove --purge -y -qq shellinabox || echo "ShellInABox already uninstalled"
# Remove service
sudo yunohost service remove shellinabox
# Remove Shell In A Box configuration
sudo rm -f "/etc/default/${app}"
# Remove Nginx proxy configuration
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
# Restart nginx
sudo systemctl reload nginx