1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bozon_ynh.git synced 2024-09-03 18:16:09 +02:00
bozon_ynh/scripts/remove

37 lines
898 B
Text
Raw Normal View History

2016-03-23 19:30:43 +01:00
#! /bin/bash
2016-09-05 21:11:16 +02:00
# Exit on command errors and treat unset variables as an error
set -eu
# Source YunoHost helpers
source /usr/share/yunohost/helpers
2016-04-04 22:35:43 +02:00
2016-05-23 21:40:55 +02:00
#retrieve arguments
2016-10-11 20:16:36 +02:00
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get "${app}" domain)
2016-03-23 19:30:43 +01:00
2016-10-11 20:16:36 +02:00
if [ -e "/var/www/${app}" ]; then
2016-05-23 21:40:55 +02:00
echo "Delete app"
2016-10-11 20:16:36 +02:00
sudo rm -rf /var/www/${app}
2016-05-23 21:40:55 +02:00
fi
2016-10-11 20:16:36 +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-11 20:16:36 +02:00
sudo rm -f /etc/nginx/conf.d/${domain}.d/${app}.conf
2016-05-23 21:40:55 +02:00
fi
2016-10-11 20:16:36 +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-11 20:16:36 +02:00
sudo rm -f /etc/php5/fpm/pool.d/${app}.conf
2016-05-23 21:40:55 +02:00
fi
2016-10-11 20:16:36 +02:00
if [ -e "/home/yunohost.app/${app}" ]; then
2016-05-23 21:40:55 +02:00
echo "Delete datas"
2016-10-11 20:16:36 +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-09-05 21:11:16 +02:00
# Remove app dependencies
ynh_package_autoremove "${app}-deps" || true
2016-05-23 20:59:08 +02:00
# Restart services
sudo service php5-fpm restart || true
sudo service nginx restart || true
2016-04-06 19:29:59 +02:00
sudo yunohost app ssowatconf