2015-04-28 17:32:31 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-02-21 04:04:26 +01:00
|
|
|
# Exit on command errors and treat unset variables as an error
|
2017-02-21 04:23:47 +01:00
|
|
|
set -u
|
2017-02-21 04:04:26 +01:00
|
|
|
|
2017-04-04 17:12:03 +02:00
|
|
|
# Loads the generic functions usually used in the script
|
|
|
|
source .fonctions
|
2017-03-29 19:00:53 +02:00
|
|
|
# Source app helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2017-03-10 22:47:54 +01:00
|
|
|
# Get multi-instances specific variables
|
2016-09-20 01:51:28 +02:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2015-04-28 18:48:20 +02:00
|
|
|
|
2017-03-10 22:47:54 +01:00
|
|
|
# Retrieve app settings
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
2017-03-11 21:47:03 +01:00
|
|
|
# with_mysql=$(ynh_app_setting_get "$app" with_mysql)
|
2017-03-10 22:47:54 +01:00
|
|
|
|
|
|
|
# Drop MySQL database and user as needed
|
2017-03-11 21:47:03 +01:00
|
|
|
#if [[ $with_mysql -eq 1 ]]; then
|
|
|
|
dbname=$app
|
|
|
|
dbuser=$app
|
|
|
|
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
|
|
|
|
ynh_mysql_drop_db $dbname || true
|
|
|
|
ynh_mysql_drop_user $dbuser || true
|
|
|
|
#fi
|
2017-03-10 22:47:54 +01:00
|
|
|
|
|
|
|
# Delete app directory and configurations
|
2017-04-03 14:34:39 +02:00
|
|
|
SECURE_REMOVE '/var/www/$app' # Delete directory application
|
2017-03-10 22:47:54 +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:26:55 +02:00
|
|
|
sudo systemctl reload php5-fpm
|
|
|
|
sudo systemctl reload nginx
|
2017-03-26 16:20:33 +02:00
|
|
|
sudo yunohost app ssowatconf
|