1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/teampass_ynh.git synced 2024-09-03 20:26:37 +02:00
teampass_ynh/scripts/remove

34 lines
885 B
Text
Raw Normal View History

#!/bin/bash
2015-12-18 14:11:35 +01: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)
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-12-18 14:11:35 +01:00
# Suppression du dossier de l'application
sudo rm -rf /var/www/$app
#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
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
sudo service nginx reload
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