2015-11-11 18:03:16 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-03-02 15:44:54 +01:00
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
|
|
set -u
|
2015-11-11 18:03:16 +01:00
|
|
|
|
2017-04-04 17:13:01 +02:00
|
|
|
# Loads the generic functions usually used in the script
|
|
|
|
source .fonctions
|
2017-03-29 19:25:52 +02:00
|
|
|
# Source app helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2017-03-10 22:10:45 +01:00
|
|
|
# Get multi-instances specific variables
|
2017-03-02 15:44:54 +01:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
2017-03-10 22:10:45 +01:00
|
|
|
# Retrieve app settings
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
|
|
|
|
# Delete app directory and configurations
|
2017-04-03 14:38:59 +02:00
|
|
|
SECURE_REMOVE '/var/www/$app' # Delete directory application
|
2017-03-10 22:10:45 +01:00
|
|
|
sudo rm -f "/etc/php5/fpm/pool.d/${app}.conf"
|
|
|
|
sudo rm -f "/etc/php5/fpm/conf.d/20-${app}.ini"
|
|
|
|
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
|
|
|
|
|
|
|
# Reload services
|
2017-03-26 16:29:13 +02:00
|
|
|
sudo systemctl reload php5-fpm
|
|
|
|
sudo systemctl reload nginx
|