2015-10-21 13:03:49 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-10-10 14:09:26 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2021-01-11 23:46:48 +01:00
|
|
|
source _common.sh
|
2017-02-04 19:20:51 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2017-10-10 14:09:26 +02:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
2020-02-08 23:34:06 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE SERVICE FROM ADMIN PANEL
|
|
|
|
#=================================================
|
|
|
|
|
2021-03-17 20:59:57 +01:00
|
|
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
2021-01-11 23:46:48 +01:00
|
|
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
|
|
|
then
|
|
|
|
ynh_script_progression --message="Removing $app service..." --weight=1
|
|
|
|
yunohost service remove $app
|
2020-02-08 23:34:06 +01:00
|
|
|
fi
|
|
|
|
|
2017-10-10 14:09:26 +02:00
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
2021-01-11 23:46:48 +01:00
|
|
|
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
|
2017-10-10 14:09:26 +02:00
|
|
|
|
2021-01-11 23:46:48 +01:00
|
|
|
# Remove the dedicated systemd config
|
2017-10-12 12:47:51 +02:00
|
|
|
ynh_remove_systemd_config
|
|
|
|
|
2022-06-22 11:09:45 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE LOGROTATE CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
|
|
|
|
|
|
|
|
# Remove the app-specific logrotate config
|
|
|
|
ynh_remove_logrotate
|
|
|
|
|
2017-10-10 14:09:26 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2021-01-11 23:46:48 +01:00
|
|
|
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5
|
2015-10-21 14:33:49 +02:00
|
|
|
|
2021-01-11 23:46:48 +01:00
|
|
|
# Remove the dedicated NGINX config
|
2017-10-10 14:26:45 +02:00
|
|
|
ynh_remove_nginx_config
|
2015-10-21 14:33:49 +02:00
|
|
|
|
2021-01-11 23:46:48 +01:00
|
|
|
#=================================================
|
2022-06-22 11:09:45 +02:00
|
|
|
# SPECIFIC REMOVE
|
2017-10-10 14:09:26 +02:00
|
|
|
#=================================================
|
2022-06-22 11:09:45 +02:00
|
|
|
# REMOVE VARIOUS FILES
|
2017-10-10 14:09:26 +02:00
|
|
|
#=================================================
|
2022-06-22 11:09:45 +02:00
|
|
|
ynh_script_progression --message="Removing various files..." --weight=1
|
2017-10-10 14:09:26 +02:00
|
|
|
|
2021-01-11 23:46:48 +01:00
|
|
|
ynh_secure_remove --file="/var/log/$app"
|
2017-10-10 14:09:26 +02:00
|
|
|
|
2021-01-11 23:46:48 +01:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2017-10-10 14:09:26 +02:00
|
|
|
|
2021-01-11 23:46:48 +01:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|