2017-01-08 12:17:57 +01:00
|
|
|
#!/bin/bash
|
2016-03-23 19:30:43 +01:00
|
|
|
|
2016-10-13 06:51:38 +02:00
|
|
|
# Exit on command errors and treat unset variables as an error
|
2017-02-03 16:41:51 +01:00
|
|
|
set -u
|
2016-04-04 22:35:43 +02:00
|
|
|
|
2016-10-13 06:51:38 +02:00
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
2016-05-23 21:40:55 +02:00
|
|
|
|
|
|
|
#retrieve arguments
|
2016-10-13 06:51:38 +02:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
domain=$(ynh_app_setting_get "${app}" domain)
|
2016-03-23 19:30:43 +01:00
|
|
|
|
2016-10-13 06:51:38 +02:00
|
|
|
if [ -e "/var/www/${app}" ]; then
|
2016-05-23 21:40:55 +02:00
|
|
|
echo "Delete app"
|
2016-10-13 06:51:38 +02:00
|
|
|
sudo rm -rf /var/www/${app}
|
2016-05-23 21:40:55 +02:00
|
|
|
fi
|
2016-10-13 06:51:38 +02:00
|
|
|
if [ -e "/etc/nginx/conf.d/${domain}.d/${app}.conf" ]; then
|
2016-05-23 21:40:55 +02:00
|
|
|
echo "Delete Nginx config"
|
2016-10-13 06:51:38 +02:00
|
|
|
sudo rm -f /etc/nginx/conf.d/${domain}.d/${app}.conf
|
2016-05-23 21:40:55 +02:00
|
|
|
fi
|
2016-10-13 06:51:38 +02:00
|
|
|
if [ -e "/etc/php5/fpm/pool.d/${app}.conf" ]; then
|
2016-05-23 21:40:55 +02:00
|
|
|
echo "Delete fpm config"
|
2016-10-13 06:51:38 +02:00
|
|
|
sudo rm -f /etc/php5/fpm/pool.d/${app}.conf
|
2016-05-23 21:40:55 +02:00
|
|
|
fi
|
2016-10-13 06:51:38 +02:00
|
|
|
if [ -e "/home/yunohost.app/${app}" ]; then
|
2016-05-23 21:40:55 +02:00
|
|
|
echo "Delete datas"
|
2016-10-13 06:51:38 +02:00
|
|
|
sudo rm -rf /home/yunohost.app/${app}
|
2016-05-23 21:40:55 +02:00
|
|
|
fi
|
2016-04-06 19:29:59 +02:00
|
|
|
|
2016-05-23 20:59:08 +02:00
|
|
|
# Restart services
|
|
|
|
sudo service php5-fpm restart || true
|
2016-10-13 06:51:38 +02:00
|
|
|
sudo service nginx reload || true
|
2016-04-06 19:29:59 +02:00
|
|
|
sudo yunohost app ssowatconf
|