2017-10-26 13:01:33 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2024-01-19 17:14:28 +01:00
|
|
|
# REMOVE SYSTEM CONFIGURATIONS
|
2017-10-26 13:01:33 +02:00
|
|
|
#=================================================
|
2024-01-19 17:14:28 +01:00
|
|
|
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
2017-10-26 13:01:33 +02:00
|
|
|
|
2021-02-13 18:14:54 +01:00
|
|
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
2024-01-19 17:14:28 +01:00
|
|
|
if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then
|
|
|
|
yunohost service remove "$app"
|
2017-10-26 13:01:33 +02:00
|
|
|
fi
|
|
|
|
|
2021-02-13 18:14:54 +01:00
|
|
|
# Remove the dedicated systemd config
|
2024-01-19 17:29:18 +01:00
|
|
|
# It seems the simple stop is not enough…
|
|
|
|
ynh_systemd_action --service_name="$app" --action="stop"
|
|
|
|
pkill -u "$app" || true
|
2021-02-13 18:14:54 +01:00
|
|
|
ynh_remove_systemd_config
|
2017-10-26 13:01:33 +02:00
|
|
|
|
|
|
|
# Remove the app-specific logrotate config
|
|
|
|
ynh_remove_logrotate
|
|
|
|
|
|
|
|
#=================================================
|
2021-02-13 18:14:54 +01:00
|
|
|
# SPECIFIC REMOVE
|
2017-10-26 13:01:33 +02:00
|
|
|
#=================================================
|
2021-02-13 18:14:54 +01:00
|
|
|
# REMOVE VARIOUS FILES
|
2017-10-26 13:01:33 +02:00
|
|
|
#=================================================
|
2021-02-13 18:14:54 +01:00
|
|
|
ynh_script_progression --message="Removing various files..." --weight=1
|
|
|
|
|
|
|
|
# Remove the passwd file
|
2022-06-20 01:41:47 +02:00
|
|
|
ynh_secure_remove --file="/etc/mosquitto/passwd"
|
2021-02-13 18:14:54 +01:00
|
|
|
|
|
|
|
# Remove the config file
|
2022-06-20 01:41:47 +02:00
|
|
|
ynh_secure_remove --file="/etc/mosquitto/conf.d/default.conf"
|
2021-02-13 18:14:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|