1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/restic_ynh.git synced 2024-09-03 20:16:22 +02:00
restic_ynh/scripts/remove
Lionel Coupouchetty-Ramouchetty ef38087874 Remove all scripts when uninstalling
2020-03-04 22:08:48 +01:00

44 lines
1.5 KiB
Bash
Executable file

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
app=$YNH_APP_INSTANCE_NAME
export final_path="/opt/yunohost/${app}"
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_remove_app_dependencies
#=================================================
# REMOVE FILES
#=================================================
systemctl stop ${app}.timer
systemctl disable ${app}.timer
ynh_remove_systemd_config --service=${app}
ynh_remove_systemd_config --service=${app}_check
ynh_remove_systemd_config --service=${app}_check_read_data
ynh_secure_remove "/etc/systemd/system/${app}.timer"
ynh_secure_remove "/etc/systemd/system/${app}_check.timer"
ynh_secure_remove "/etc/systemd/system/${app}_check_read_data.timer"
ynh_secure_remove "/usr/local/bin/backup-with-${app}"
ynh_secure_remove "/etc/yunohost/hooks.d/backup_method/05-${app}_app"
ynh_secure_remove "${final_path}/check_method"
ynh_secure_remove "${final_path}/check-${app}"
ynh_secure_remove "${final_path}"
#=================================================
# REMOVE SSH CONFIG
#=================================================
sed -e "/Host ${server}/,+6d" /root/.ssh/config -i || true