2014-06-02 13:38:03 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-01-29 00:55:27 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2014-06-02 13:38:03 +02:00
|
|
|
|
2018-01-29 00:55:27 +01:00
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2022-03-25 01:09:30 +01:00
|
|
|
ynh_script_progression --message="Loading installation settings..."
|
2018-01-29 00:55:27 +01:00
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
2022-03-25 01:09:30 +01:00
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
|
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
2018-01-29 00:55:27 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
2022-03-25 01:09:30 +01:00
|
|
|
# REMOVE SUPERVISOR
|
2018-01-29 00:55:27 +01:00
|
|
|
#=================================================
|
2022-03-25 01:09:30 +01:00
|
|
|
ynh_script_progression --message="Removing supervisor configuration..."
|
2018-01-29 00:55:27 +01:00
|
|
|
|
2022-03-25 01:09:30 +01:00
|
|
|
supervisorctl stop $app
|
|
|
|
ynh_secure_remove --file="/etc/supervisor/conf.d/$app.conf"
|
|
|
|
supervisorctl update
|
2018-01-29 00:55:27 +01:00
|
|
|
|
|
|
|
#=================================================
|
2022-03-25 01:09:30 +01:00
|
|
|
# REMOVE APP MAIN DIR
|
2018-01-29 00:55:27 +01:00
|
|
|
#=================================================
|
2022-03-25 01:09:30 +01:00
|
|
|
ynh_script_progression --message="Removing app main directory..."
|
2018-01-29 00:55:27 +01:00
|
|
|
|
2022-03-25 01:09:30 +01:00
|
|
|
# Remove the app directory securely
|
|
|
|
ynh_secure_remove --file="$final_path"
|
2018-01-29 00:55:27 +01:00
|
|
|
|
|
|
|
#=================================================
|
2022-03-25 01:09:30 +01:00
|
|
|
# REMOVE NGINX CONFIGURATION
|
2018-01-29 00:55:27 +01:00
|
|
|
#=================================================
|
2022-03-25 01:09:30 +01:00
|
|
|
ynh_script_progression --message="Removing NGINX web server configuration..."
|
2016-02-03 16:23:33 +01:00
|
|
|
|
2022-03-25 01:09:30 +01:00
|
|
|
# Remove the dedicated NGINX config
|
|
|
|
ynh_remove_nginx_config
|
2018-01-29 00:55:27 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
2022-03-25 01:09:30 +01:00
|
|
|
ynh_script_progression --message="Removing dependencies..."
|
2018-01-29 00:55:27 +01:00
|
|
|
|
|
|
|
# Remove metapackage and its dependencies
|
|
|
|
ynh_remove_app_dependencies
|
2016-02-03 12:59:58 +01:00
|
|
|
|
2018-01-29 00:55:27 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
2022-03-25 01:09:30 +01:00
|
|
|
ynh_script_progression --message="Removing the dedicated system user..."
|
2016-02-03 16:48:44 +01:00
|
|
|
|
2018-01-29 00:55:27 +01:00
|
|
|
# Delete a system user
|
2022-03-25 01:09:30 +01:00
|
|
|
ynh_system_user_delete --username=$app
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Removal of $app completed"
|