2017-02-13 20:43:41 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-01-30 23:44:49 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2019-04-30 19:15:33 +02:00
|
|
|
source _common.sh
|
|
|
|
source experimental_helper.sh
|
2017-07-21 22:28:49 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2018-01-30 23:44:49 +01:00
|
|
|
#=================================================
|
2019-04-30 19:15:33 +02:00
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# REMOVE SERVICE FROM ADMIN PANEL
|
2018-01-30 23:44:49 +01:00
|
|
|
#=================================================
|
|
|
|
|
2019-04-30 19:15:33 +02:00
|
|
|
# Remove a service from the admin panel, added by `yunohost service add`
|
2024-02-06 20:42:00 +01:00
|
|
|
if yunohost service status $app >/dev/null 2>&1
|
2019-04-30 19:15:33 +02:00
|
|
|
then
|
2024-02-06 20:42:00 +01:00
|
|
|
yunohost service remove $app
|
2019-04-30 19:15:33 +02:00
|
|
|
fi
|
|
|
|
|
2024-02-06 20:42:00 +01:00
|
|
|
if yunohost service status $app-coturn >/dev/null 2>&1
|
2019-04-30 19:15:33 +02:00
|
|
|
then
|
2024-02-06 20:42:00 +01:00
|
|
|
yunohost service remove $app-coturn
|
2019-04-30 19:15:33 +02:00
|
|
|
fi
|
2017-02-13 20:43:41 +01:00
|
|
|
|
2018-01-30 23:44:49 +01:00
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
2019-04-30 19:15:33 +02:00
|
|
|
ynh_script_progression --message="Stopping and removing the systemd service" --weight=2
|
2018-01-30 23:44:49 +01:00
|
|
|
|
2024-02-06 20:42:00 +01:00
|
|
|
ynh_remove_systemd_config --service=$app
|
|
|
|
ynh_remove_systemd_config --service=$app-coturn
|
2018-01-30 23:44:49 +01:00
|
|
|
|
|
|
|
#=================================================
|
2019-04-30 19:15:33 +02:00
|
|
|
# REMOVE APP MAIN DIR
|
2018-01-30 23:44:49 +01:00
|
|
|
#=================================================
|
2023-11-01 18:52:07 +01:00
|
|
|
ynh_script_progression --message="Removing app main directory" --weight=2
|
2018-01-30 23:44:49 +01:00
|
|
|
|
2023-11-01 18:52:07 +01:00
|
|
|
ynh_secure_remove --file=$code_dir
|
2019-04-30 19:15:33 +02:00
|
|
|
ynh_secure_remove --file=/var/log/matrix-$app
|
|
|
|
ynh_secure_remove --file=/etc/matrix-$app
|
|
|
|
ynh_secure_remove --file=/etc/default/matrix-$app
|
|
|
|
ynh_secure_remove --file=/etc/default/coturn-$app
|
2019-12-01 22:18:56 +01:00
|
|
|
ynh_secure_remove --file=/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf
|
2018-01-19 22:05:39 +01:00
|
|
|
|
2018-01-30 23:44:49 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2022-10-28 10:59:40 +02:00
|
|
|
ynh_script_progression --message="Removing NGINX web server configuration" --weight=2
|
2018-01-30 23:44:49 +01:00
|
|
|
|
2019-04-30 19:15:33 +02:00
|
|
|
# Remove the dedicated nginx config
|
2018-01-19 22:05:39 +01:00
|
|
|
ynh_remove_nginx_config
|
2017-07-21 22:28:49 +02:00
|
|
|
|
2020-02-22 00:42:32 +01:00
|
|
|
# Remove the dedicated php-fpm config
|
|
|
|
ynh_remove_fpm_config
|
|
|
|
|
2018-01-30 23:44:49 +01:00
|
|
|
#=================================================
|
2019-04-30 19:15:33 +02:00
|
|
|
# REMOVE LOGROTATE CONFIGURATION
|
2018-01-30 23:44:49 +01:00
|
|
|
#=================================================
|
2019-04-30 19:15:33 +02:00
|
|
|
ynh_script_progression --message="Removing logrotate configuration" --weight=1
|
2017-07-21 22:28:49 +02:00
|
|
|
|
2019-04-30 19:15:33 +02:00
|
|
|
# Remove the app-specific logrotate config
|
|
|
|
ynh_remove_logrotate
|
2017-07-21 22:28:49 +02:00
|
|
|
|
2019-02-12 21:24:25 +01:00
|
|
|
#=================================================
|
2019-04-30 19:15:33 +02:00
|
|
|
# REMOVE FAIL2BAN CONFIGURATION
|
2019-02-12 21:24:25 +01:00
|
|
|
#=================================================
|
2022-10-28 10:59:40 +02:00
|
|
|
ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=8
|
2019-02-12 21:24:25 +01:00
|
|
|
|
2019-04-30 19:15:33 +02:00
|
|
|
# Remove the dedicated fail2ban config
|
|
|
|
ynh_remove_fail2ban_config
|
2019-02-12 21:24:25 +01:00
|
|
|
|
2018-01-30 23:44:49 +01:00
|
|
|
#=================================================
|
2019-04-30 19:15:33 +02:00
|
|
|
# GENERIC FINALIZATION
|
2018-01-30 23:44:49 +01:00
|
|
|
#=================================================
|
2017-02-13 20:43:41 +01:00
|
|
|
|
2019-04-30 19:15:33 +02:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|
2020-12-07 16:34:41 +01:00
|
|
|
sleep 1
|