2022-04-29 12:18:34 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2023-09-14 19:16:04 +02:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_script_progression "Loading installation settings..."
|
2023-09-14 19:16:04 +02:00
|
|
|
|
2024-06-23 08:56:30 +02:00
|
|
|
redis_db=$(ynh_app_setting_get --key=redis_db)
|
2022-04-29 12:18:34 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
2024-06-23 08:56:30 +02:00
|
|
|
if ynh_hide_warnings yunohost service status $app >/dev/null
|
2022-04-29 12:18:34 +02:00
|
|
|
then
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_script_progression "Removing $app services integration..."
|
2022-04-29 12:18:34 +02:00
|
|
|
yunohost service remove $app
|
2023-02-28 21:01:56 +01:00
|
|
|
yunohost service remove ${app}_workers
|
2022-04-29 12:18:34 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STOP AND REMOVE SERVICE
|
|
|
|
#=================================================
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_script_progression "Stopping and removing the systemd service..."
|
2022-04-29 12:18:34 +02:00
|
|
|
|
|
|
|
# Remove the dedicated systemd config
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_config_remove_systemd"${app}"
|
|
|
|
ynh_config_remove_systemd"${app}_workers"
|
2022-12-31 18:14:15 +01:00
|
|
|
|
2023-02-28 22:28:45 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE VARIOUS FILES
|
|
|
|
#=================================================
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_script_progression "Removing various files..."
|
2022-04-29 12:18:34 +02:00
|
|
|
|
|
|
|
# Remove the dedicated NGINX config
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_config_remove_nginx
|
2022-04-29 12:18:34 +02:00
|
|
|
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_config_remove_logrotate
|
2023-03-03 16:12:49 +01:00
|
|
|
|
2023-09-14 19:16:04 +02:00
|
|
|
# Remove the redis database
|
|
|
|
ynh_redis_remove_db "$redis_db"
|
|
|
|
|
2022-04-29 12:18:34 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-23 08:56:30 +02:00
|
|
|
ynh_script_progression "Removal of $app completed"
|