2014-06-18 00:05:18 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-11-22 14:37:01 +01:00
|
|
|
app=leed
|
|
|
|
|
|
|
|
# Récupère les infos de l'application.
|
2014-06-18 00:05:18 +02:00
|
|
|
root_pwd=$(sudo cat /etc/yunohost/mysql)
|
2015-11-22 14:37:01 +01:00
|
|
|
domain=$(sudo yunohost app setting $app domain)
|
|
|
|
|
|
|
|
# Utilise '$app' comme nom d'utilisateur et de base de donnée
|
|
|
|
db_user=$app
|
|
|
|
mysql -u root -p$root_pwd -e "DROP DATABASE $db_user ; DROP USER $db_user@localhost ;"
|
|
|
|
|
|
|
|
# Suppression du dossier de l'application
|
|
|
|
sudo rm -rf /var/www/$app
|
|
|
|
|
2014-08-17 17:48:37 +02:00
|
|
|
# Suppression de la configuration nginx
|
2015-11-22 14:37:01 +01:00
|
|
|
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
2014-08-17 17:48:37 +02:00
|
|
|
|
2014-09-15 10:44:58 +02:00
|
|
|
# Retirer le cron
|
2015-11-22 14:37:01 +01:00
|
|
|
sudo rm -f /etc/cron.d/$app
|
|
|
|
|
|
|
|
# Suppression de la configuration du pool php-fpm
|
|
|
|
sudo rm -f /etc/php5/fpm/pool.d/$app.conf
|
|
|
|
sudo rm -f /etc/php5/fpm/conf.d/20-$app.ini
|
2014-08-17 17:48:37 +02:00
|
|
|
|
2015-11-22 14:37:01 +01:00
|
|
|
# Recharge la configuration Nginx et php5-fpm
|
2014-08-17 17:48:37 +02:00
|
|
|
sudo service nginx reload
|
2016-05-15 11:34:18 +02:00
|
|
|
sudo service php5-fpm reload
|
2015-11-22 14:37:01 +01:00
|
|
|
# Régénère la configuration de SSOwat
|
2014-08-17 17:48:37 +02:00
|
|
|
sudo yunohost app ssowatconf
|