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
|
|
|
ynh_version=$(sudo yunohost -v | grep "moulinette:" | cut -d' ' -f2 | cut -d'.' -f1,2)
|
|
|
|
|
|
|
|
#retrieve arguments
|
|
|
|
if [ $ynh_version = "2.4" ]; then
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
# Source app helpers
|
|
|
|
. /usr/share/yunohost/helpers
|
|
|
|
else
|
|
|
|
app=bozon
|
|
|
|
fi
|
2016-03-23 19:30:43 +01:00
|
|
|
domain=$(sudo yunohost app setting $app domain)
|
|
|
|
|
2016-05-23 21:40:55 +02:00
|
|
|
if [ -e "/var/www/$app" ]; then
|
|
|
|
echo "Delete app"
|
|
|
|
sudo rm -rf /var/www/$app
|
|
|
|
fi
|
|
|
|
if [ -e "/etc/nginx/conf.d/$domain.d/$app.conf" ]; then
|
|
|
|
echo "Delete Nginx config"
|
|
|
|
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
|
|
|
fi
|
|
|
|
if [ -e "/etc/php5/fpm/pool.d/$app.conf" ]; then
|
|
|
|
echo "Delete fpm config"
|
|
|
|
sudo rm -f /etc/php5/fpm/pool.d/$app.conf
|
|
|
|
fi
|
|
|
|
if [ -e "/home/yunohost.app/$app" ]; then
|
|
|
|
echo "Delete datas"
|
|
|
|
sudo rm -rf /home/yunohost.app/$app
|
|
|
|
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
|
2016-05-23 21:40:55 +02:00
|
|
|
|
|
|
|
echo -e "\e[0m"
|