2014-05-10 11:54:15 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-05-01 15:47:20 +02:00
|
|
|
#=================================================
|
2022-03-06 19:01:21 +01:00
|
|
|
# GENERIC START
|
2017-05-01 15:47:20 +02:00
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2014-05-10 11:54:15 +02:00
|
|
|
|
2019-03-03 20:32:26 +01:00
|
|
|
source _common.sh
|
2017-05-01 15:47:20 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-07-04 21:16:34 +02:00
|
|
|
|
2017-05-01 15:47:20 +02:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2019-05-18 20:15:36 +02:00
|
|
|
ynh_script_progression --message="Loading installation settings..." --weight=2
|
2016-07-04 21:16:34 +02:00
|
|
|
|
2017-05-01 15:47:20 +02:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2016-07-04 21:16:34 +02:00
|
|
|
|
2019-05-18 20:15:36 +02:00
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
2017-05-01 15:47:20 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
2020-12-19 23:34:40 +01:00
|
|
|
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2
|
2017-05-01 15:47:20 +02:00
|
|
|
|
2017-08-28 03:03:36 +02:00
|
|
|
# Remove the uwsgi configuration
|
2020-04-10 22:02:55 +02:00
|
|
|
ynh_systemd_action --service_name "uwsgi-app@$app.service" --action stop
|
|
|
|
ynh_remove_uwsgi_service
|
2017-05-01 15:47:20 +02:00
|
|
|
|
|
|
|
#=================================================
|
2022-03-06 19:01:21 +01:00
|
|
|
# REMOVE APP MAIN DIR
|
2017-05-01 15:47:20 +02:00
|
|
|
#=================================================
|
2020-12-19 23:34:40 +01:00
|
|
|
ynh_script_progression --message="Removing app main directory..." --weight=2
|
2017-05-01 15:47:20 +02:00
|
|
|
|
2022-03-06 19:01:21 +01:00
|
|
|
# Remove the app directory securely
|
2019-05-18 20:15:36 +02:00
|
|
|
ynh_secure_remove --file="$final_path"
|
2017-05-01 15:47:20 +02:00
|
|
|
|
|
|
|
#=================================================
|
2022-03-06 19:01:21 +01:00
|
|
|
# REMOVE NGINX CONFIGURATION
|
2017-05-01 15:47:20 +02:00
|
|
|
#=================================================
|
2020-09-19 16:09:37 +02:00
|
|
|
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=2
|
2017-05-01 15:47:20 +02:00
|
|
|
|
2020-09-19 16:09:37 +02:00
|
|
|
# Remove the dedicated NGINX config
|
2017-08-28 03:03:36 +02:00
|
|
|
ynh_remove_nginx_config
|
2017-05-01 15:47:20 +02:00
|
|
|
|
2022-03-06 19:01:21 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removing dependencies..." --weight=3
|
|
|
|
|
|
|
|
# Remove metapackage and its dependencies
|
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
2017-05-01 15:47:20 +02:00
|
|
|
#=================================================
|
2019-03-03 20:32:26 +01:00
|
|
|
# GENERIC FINALIZATION
|
2017-05-01 15:47:20 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
2020-12-19 23:34:40 +01:00
|
|
|
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
|
2016-07-05 12:49:44 +02:00
|
|
|
|
2017-08-28 03:03:36 +02:00
|
|
|
# Delete a system user
|
2019-05-18 20:15:36 +02:00
|
|
|
ynh_system_user_delete --username=$app
|
2019-03-03 20:33:02 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2022-06-29 01:07:32 +02:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|