2017-04-26 19:01:53 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Treat unset variables as an error
|
|
|
|
set -u
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
db_name=$(ynh_app_setting_get $app db_name)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_secure_remove "/var/www/$app"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX AND PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
2020-04-07 14:13:57 +02:00
|
|
|
|
2019-06-09 19:21:27 +02:00
|
|
|
ynh_secure_remove --file="/etc/php5/fpm/pool.d/${app}.conf"
|
2020-04-07 14:13:57 +02:00
|
|
|
ynh_secure_remove --file="/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
2017-04-26 19:01:53 +02:00
|
|
|
|
|
|
|
# Reload services
|
2019-06-09 19:21:27 +02:00
|
|
|
systemctl restart php5-fpm
|
|
|
|
systemctl reload nginx
|
2017-04-26 19:01:53 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
|
|
|
|
2019-05-24 04:56:16 +02:00
|
|
|
ynh_system_user_delete $app
|