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
|
|
|
|
#=================================================
|
2023-08-18 11:38:35 +02:00
|
|
|
#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=2
|
2016-07-04 21:16:34 +02:00
|
|
|
|
2023-08-18 11:38:35 +02:00
|
|
|
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
|
2016-07-04 21:16:34 +02:00
|
|
|
|
2023-08-18 11:38:35 +02:00
|
|
|
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
|
|
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
|
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
|
|
|
#=================================================
|
2023-08-18 11:38:35 +02:00
|
|
|
#REMOVEME? 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
|
2023-08-18 11:38:35 +02:00
|
|
|
#REMOVEME? ynh_secure_remove --file="$install_dir"
|
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
|
|
|
|
#=================================================
|
2023-08-18 11:38:35 +02:00
|
|
|
#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=3
|
2022-03-06 19:01:21 +01:00
|
|
|
|
|
|
|
# Remove metapackage and its dependencies
|
2023-08-18 11:38:35 +02:00
|
|
|
#REMOVEME? ynh_remove_app_dependencies
|
2022-03-06 19:01:21 +01:00
|
|
|
|
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
|
|
|
|
#=================================================
|
2023-08-18 11:38:35 +02:00
|
|
|
#REMOVEME? 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
|
2023-08-18 11:38:35 +02:00
|
|
|
#REMOVEME? 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
|