2014-06-18 00:05:18 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
db_user=leed
|
|
|
|
db_name=leed
|
|
|
|
root_pwd=$(sudo cat /etc/yunohost/mysql)
|
|
|
|
domain=$(sudo yunohost app setting leed domain)
|
2014-08-17 17:48:37 +02:00
|
|
|
admin=$(sudo yunohost app setting leed admin)
|
|
|
|
path=$(sudo yunohost app setting leed path)
|
2014-06-18 00:05:18 +02:00
|
|
|
|
2014-08-17 17:48:37 +02:00
|
|
|
# Suppression de la base de donnée et son user
|
2014-06-18 00:05:18 +02:00
|
|
|
mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;"
|
2014-08-17 17:48:37 +02:00
|
|
|
# Suppression du dossier
|
2014-06-18 00:05:18 +02:00
|
|
|
sudo rm -rf /var/www/leed
|
2014-08-17 17:48:37 +02:00
|
|
|
# Suppression de la configuration nginx
|
|
|
|
sudo rm -f /etc/nginx/conf.d/$domain.d/leed.conf
|
|
|
|
|
|
|
|
# Retirer les lignes du crontab
|
|
|
|
path_no_slash=$(echo $path | cut -d '/' -f 2)
|
|
|
|
sudo crontab -l -u $admin | sudo tee crontab_file
|
|
|
|
sudo sed -i "/Mise a jour de leed /d" crontab_file
|
|
|
|
sudo sed -i "/$path_no_slash\/action.php?action=synchronize&code=/d" crontab_file
|
|
|
|
sudo crontab -u $admin crontab_file
|
|
|
|
|
|
|
|
# Reload Nginx and regenerate SSOwat conf
|
|
|
|
sudo service nginx reload
|
|
|
|
sudo yunohost app ssowatconf
|