1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/etherpad_mypads_ynh.git synced 2024-09-03 18:36:09 +02:00
etherpad_mypads_ynh/scripts/remove
2017-03-19 18:26:09 +01:00

81 lines
2.4 KiB
Bash
Executable file

#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source .fonctions
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
port=$(ynh_app_setting_get $app port)
db_name=$(ynh_app_setting_get $app db_name)
#=================================================
# STANDARD REMOVE
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
if [ -e "/etc/systemd/system/$app.service" ]; then
echo "Delete systemd script"
sudo systemctl stop $app
sudo systemctl disable $app.service
sudo rm "/etc/systemd/system/$app.service"
fi
#=================================================
# DISABLE SERVICE IN ADMIN PANEL
#=================================================
if sudo yunohost service status | grep -q $app # Test l'existence du service dans Yunohost
then
echo "Remove $app service"
sudo yunohost service remove $app
fi
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_remove_app_dependencies
#=================================================
# REMOVE THE SQL BDD
#=================================================
ynh_mysql_remove_db $db_name $db_name # Suppression de la base de donnée et de l'utilisateur associé.
#=================================================
# REMOVE THE MAIN DIR OF THE APP
#=================================================
SECURE_REMOVE '/var/www/$app' # Suppression du dossier de l'application
#=================================================
# REMOVE THE NGINX CONFIGURATION
#=================================================
REMOVE_NGINX_CONF # Suppression de la configuration nginx
#=================================================
# REMOVE THE LOGROTATE CONFIG
#=================================================
ynh_remove_logrotate # Suppression de la configuration de logrotate
#=================================================
# GENERIC FINALISATION
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_system_user_delete $app