2017-02-10 17:06:59 +01:00
|
|
|
#!/bin/bash
|
2017-10-02 02:07:41 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
source _future.sh
|
2017-02-10 17:06:59 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2017-10-02 02:07:41 +02:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
readonly app=$YNH_APP_INSTANCE_NAME
|
|
|
|
readonly domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
readonly final_path=$(ynh_app_setting_get "$app" final_path)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_systemd_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DISABLE SERVICE IN ADMIN PANEL
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
if yunohost service status | grep -q $app # Test l'existence du service dans Yunohost
|
|
|
|
then
|
|
|
|
echo "Remove $app service"
|
|
|
|
yunohost service remove $app
|
|
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DB
|
|
|
|
#=================================================
|
|
|
|
mongo $app --eval "db.dropDatabase()"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE NODEJS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_nodejs
|
|
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE MONGODB
|
|
|
|
#=================================================
|
|
|
|
# TODO / FIXME : remove the keys added ?
|
|
|
|
#apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
|
|
|
|
|
|
|
|
#rm -f /etc/apt/sources.list.d/mongodb-org-3.2.list
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE MAIN DIR OF THE APP
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_secure_remove "/var/www/$app"
|
|
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_system_user_delete $app
|
|
|
|
|
|
|
|
|