2017-10-26 13:01:33 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
2021-02-13 18:14:54 +01:00
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
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`)
|
|
|
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
2017-10-26 13:01:33 +02:00
|
|
|
then
|
2021-02-13 18:14:54 +01:00
|
|
|
ynh_script_progression --message="Removing $app service integration..." --weight=1
|
2017-10-26 13:01:33 +02:00
|
|
|
yunohost service remove $app
|
|
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
2021-02-13 18:14:54 +01:00
|
|
|
# STOP AND REMOVE SERVICE
|
2017-10-26 13:01:33 +02:00
|
|
|
#=================================================
|
2021-02-13 18:14:54 +01:00
|
|
|
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
|
2017-10-26 13:01:33 +02:00
|
|
|
|
2021-02-13 18:14:54 +01:00
|
|
|
# Remove the dedicated systemd config
|
|
|
|
ynh_remove_systemd_config
|
2017-10-26 13:01:33 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE LOGROTATE CONFIGURATION
|
|
|
|
#=================================================
|
2021-02-13 18:14:54 +01:00
|
|
|
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
|
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 log files
|
2023-12-13 00:28:26 +01:00
|
|
|
ynh_secure_remove --file="/var/log/$app"
|
2021-02-13 18:14:54 +01:00
|
|
|
|
|
|
|
# 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
|