2018-04-17 00:02:25 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
2019-01-08 22:17:04 +01:00
|
|
|
#=================================================
|
2021-04-16 14:14:27 +02:00
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
2019-01-08 22:17:04 +01:00
|
|
|
#=================================================
|
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
if ynh_hide_warnings yunohost service status "${app}-server" >/dev/null
|
2019-01-08 22:17:04 +01:00
|
|
|
then
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_script_progression "Removing ${app}-server service integration..."
|
2021-04-16 14:14:27 +02:00
|
|
|
yunohost service remove "${app}-server"
|
2019-01-08 22:17:04 +01:00
|
|
|
fi
|
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
if ynh_hide_warnings yunohost service status "${app}-worker" >/dev/null
|
2019-01-08 22:17:04 +01:00
|
|
|
then
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_script_progression "Removing ${app}-worker service integration..."
|
2021-04-16 14:14:27 +02:00
|
|
|
yunohost service remove "${app}-worker"
|
2019-01-08 22:17:04 +01:00
|
|
|
fi
|
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
if ynh_hide_warnings yunohost service status "${app}-beat" >/dev/null
|
2019-01-08 22:17:04 +01:00
|
|
|
then
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_script_progression "Removing ${app}-beat service integration..."
|
2021-04-16 14:14:27 +02:00
|
|
|
yunohost service remove "${app}-beat"
|
2019-01-08 22:17:04 +01:00
|
|
|
fi
|
|
|
|
|
2019-01-14 21:30:46 +01:00
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_script_progression "Stopping and removing the systemd service..."
|
2019-01-14 21:30:46 +01:00
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_systemctl --service="${app}-beat" --action="stop" --log_path="systemd"
|
|
|
|
ynh_systemctl --service="${app}-server" --action="stop" --log_path="systemd"
|
|
|
|
ynh_systemctl --service="${app}-worker" --action="stop" --log_path="systemd"
|
2019-01-14 21:30:46 +01:00
|
|
|
|
|
|
|
# Remove the dedicated systemd config
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_config_remove_systemd"${app}-beat"
|
|
|
|
ynh_config_remove_systemd"${app}-server"
|
|
|
|
ynh_config_remove_systemd"${app}-worker"
|
2019-01-14 21:30:46 +01:00
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_safe_rm "/etc/systemd/system/$app.target"
|
2019-01-14 21:30:46 +01:00
|
|
|
|
2018-04-17 00:02:25 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_script_progression "Removing NGINX web server configuration..."
|
2018-04-17 00:02:25 +02:00
|
|
|
|
2021-04-16 14:14:27 +02:00
|
|
|
# Remove the dedicated NGINX config
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_safe_rm "/etc/nginx/conf.d/$domain.d/funkwhale_proxy.conf"
|
|
|
|
ynh_config_remove_nginx
|
2023-06-20 10:44:18 +02:00
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_config_remove_logrotate
|
2023-06-20 10:44:18 +02:00
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_config_remove_fail2ban
|
2021-08-04 23:53:34 +02:00
|
|
|
|
|
|
|
ynh_redis_remove_db $redis_db
|
|
|
|
|
2019-04-03 14:35:09 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-09-01 22:25:43 +02:00
|
|
|
ynh_script_progression "Removal of $app completed"
|