mirror of
https://github.com/YunoHost-Apps/hubzilla_ynh.git
synced 2024-09-03 19:26:21 +02:00
Upgrade of remove script to mtach install script
This commit is contained in:
parent
4ffa2e3393
commit
3bc258acca
1 changed files with 22 additions and 16 deletions
|
@ -1,27 +1,33 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
app=hubzilla
|
|
||||||
|
|
||||||
# Retrieve arguments
|
source .fonctions # Charge les fonctions génériques habituellement utilisées dans le script
|
||||||
domain=$(sudo yunohost app setting $app domain)
|
|
||||||
path=$(sudo yunohost app setting $app path)
|
|
||||||
admin=$(sudo yunohost app setting $app admin)
|
|
||||||
is_public=$(sudo yunohost app setting $app is_public)
|
|
||||||
|
|
||||||
db_user=$app
|
# Récupère les infos de l'application.
|
||||||
db_name=$app
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
root_pwd=$(sudo cat /etc/yunohost/mysql)
|
|
||||||
domain=$(sudo yunohost app setting $app domain)
|
|
||||||
|
|
||||||
mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;"
|
# Source app helpers
|
||||||
# Remove sources
|
source /usr/share/yunohost/helpers
|
||||||
sudo rm -rf /var/www/$app
|
|
||||||
|
|
||||||
# Remove configuration files
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
db_user=$(ynh_app_setting_get $app db_user)
|
||||||
|
|
||||||
|
REMOVE_BDD $db_user # Suppression de la base de donnée et de l'utilisateur associé.
|
||||||
|
|
||||||
|
SECURE_REMOVE '/var/www/$app' # Suppression du dossier de l'application
|
||||||
|
|
||||||
|
REMOVE_NGINX_CONF # Suppression de la configuration nginx
|
||||||
|
|
||||||
|
REMOVE_FPM_CONF # Suppression de la configuration du pool php-fpm
|
||||||
|
|
||||||
# Remove poller cron job
|
# Remove poller cron job
|
||||||
sudo rm -f /etc/cron.d/poller-cron
|
sudo rm -f /etc/cron.d/poller-cron
|
||||||
|
|
||||||
# Restart services
|
|
||||||
|
# Reload services after cleaning
|
||||||
|
sudo service php5-fpm restart
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
|
|
||||||
|
# Régénère la configuration de SSOwat
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
||||||
|
|
||||||
|
echo -e "\e[0m" # Restore normal color
|
||||||
|
|
Loading…
Add table
Reference in a new issue