2020-02-23 12:02:10 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
|
2022-03-13 17:45:45 +01:00
|
|
|
#=================================================
|
2024-05-25 09:34:34 +02:00
|
|
|
# REMOVE SYSTEM CONFIGURATIONS
|
2022-03-13 17:45:45 +01:00
|
|
|
#=================================================
|
2024-05-25 09:34:34 +02:00
|
|
|
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
|
|
|
|
|
|
|
# Systemd services and timers
|
|
|
|
for suffix in "${systemd_services_suffixes[@]}"; do
|
|
|
|
if ynh_exec_warn_less yunohost service status "$app_suffix" >/dev/null; then
|
|
|
|
yunohost service remove "$app_suffix"
|
|
|
|
fi
|
2024-05-26 11:58:36 +02:00
|
|
|
ynh_systemd_action --service_name="$app$suffix.timer" --action="stop"
|
|
|
|
ynh_systemd_action --service_name="$app$suffix.timer" --action="disable"
|
2024-05-26 12:14:12 +02:00
|
|
|
ynh_remove_systemd_config --service="$app$suffix"
|
2024-05-25 09:34:34 +02:00
|
|
|
ynh_secure_remove "/etc/systemd/system/$app$suffix.timer"
|
|
|
|
done
|
2022-03-13 17:45:45 +01:00
|
|
|
|
|
|
|
# Remove the app-specific logrotate config
|
|
|
|
ynh_remove_logrotate
|
|
|
|
|
2024-05-25 09:34:34 +02:00
|
|
|
# Remove sudoers
|
|
|
|
rm "/etc/sudoers.d/$app"
|
2022-03-13 17:45:45 +01:00
|
|
|
|
2020-02-23 12:02:10 +01:00
|
|
|
ynh_secure_remove "/etc/yunohost/hooks.d/backup_method/05-${app}_app"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE SSH CONFIG
|
|
|
|
#=================================================
|
2021-03-07 16:09:16 +01:00
|
|
|
ynh_script_progression --message="Removing ssh config"
|
2022-03-13 17:45:45 +01:00
|
|
|
|
2024-05-25 09:34:34 +02:00
|
|
|
sed -e "/begin ${app}/,/end ${app}/{/.*/d}" /root/.ssh/config -i || true
|
2022-03-13 17:45:45 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Removal of $app completed"
|