2020-02-23 12:02:10 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2020-03-03 20:06:25 +01:00
|
|
|
export final_path="/opt/yunohost/${app}"
|
2020-02-23 12:02:10 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
2020-03-03 21:02:28 +01:00
|
|
|
ynh_script_progression --message="Removing dependencies" --weight=4
|
2020-02-23 12:02:10 +01:00
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE FILES
|
|
|
|
#=================================================
|
2020-03-03 21:02:28 +01:00
|
|
|
ynh_script_progression --message="Removing files" --weight=2
|
2020-03-02 22:11:41 +01:00
|
|
|
systemctl stop ${app}.timer
|
2021-02-27 22:49:02 +01:00
|
|
|
systemctl --quiet disable ${app}.timer
|
2020-03-02 22:11:41 +01:00
|
|
|
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}"
|
2020-02-23 12:02:10 +01:00
|
|
|
ynh_secure_remove "/etc/yunohost/hooks.d/backup_method/05-${app}_app"
|
2021-02-28 16:38:35 +01:00
|
|
|
ynh_secure_remove "${final_path}/check_method_${app}"
|
2020-03-03 20:06:25 +01:00
|
|
|
ynh_secure_remove "${final_path}/check-${app}"
|
|
|
|
ynh_secure_remove "${final_path}"
|
2020-02-23 12:02:10 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE SSH CONFIG
|
|
|
|
#=================================================
|
2020-03-03 21:02:28 +01:00
|
|
|
ynh_script_progression --message="Removing ssh config" --last
|
2021-02-28 16:38:35 +01:00
|
|
|
sed -e "/begin ${app}/,/end ${app}/{/.*/d}" /root/.ssh/config -i || true
|