2015-05-30 19:37:21 +02:00
|
|
|
#!/bin/bash
|
2015-12-18 14:11:35 +01:00
|
|
|
|
2015-05-30 19:37:21 +02:00
|
|
|
app=teampass
|
|
|
|
|
2015-12-18 14:11:35 +01:00
|
|
|
# Récupère les infos de l'application.
|
|
|
|
root_pwd=$(sudo cat /etc/yunohost/mysql)
|
2015-05-30 19:37:21 +02:00
|
|
|
domain=$(sudo yunohost app setting $app domain)
|
|
|
|
|
2015-12-18 14:11:35 +01:00
|
|
|
# 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 ;"
|
2015-05-30 19:37:21 +02:00
|
|
|
|
2015-12-18 14:11:35 +01:00
|
|
|
# Suppression du dossier de l'application
|
|
|
|
sudo rm -rf /var/www/$app
|
2015-05-30 19:37:21 +02:00
|
|
|
|
2015-12-06 12:49:32 +01:00
|
|
|
#Remove the sk.php
|
|
|
|
sudo rm -rf /etc/teampass/
|
|
|
|
|
2015-12-18 14:11:35 +01:00
|
|
|
# Suppression de la configuration nginx
|
|
|
|
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
|
|
|
|
|
|
|
# Suppression des log
|
|
|
|
sudo rm -r /var/log/$app/
|
|
|
|
|
|
|
|
# Suppression de la configuration du pool php-fpm
|
2015-12-06 12:49:32 +01:00
|
|
|
sudo rm -f /etc/php5/fpm/pool.d/$app.conf
|
|
|
|
sudo rm -f /etc/php5/fpm/conf.d/20-$app.ini
|
|
|
|
|
2015-12-18 14:11:35 +01:00
|
|
|
# Recharge la configuration Nginx et php5-fpm
|
2015-05-30 19:37:21 +02:00
|
|
|
sudo service nginx reload
|
2015-12-06 12:49:32 +01:00
|
|
|
sudo service php5-fpm reload
|
2015-12-18 14:11:35 +01:00
|
|
|
# Régénère la configuration de SSOwat
|
|
|
|
sudo yunohost app ssowatconf
|