1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/borgserver_ynh.git synced 2024-09-03 20:36:20 +02:00
borgserver_ynh/scripts/remove

42 lines
1.3 KiB
Text
Raw Normal View History

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2018-08-31 01:11:12 +02:00
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# REMOVE DEPENDENCIES
#=================================================
2023-10-25 21:57:09 +02:00
ynh_script_progression --message="Removing dependencies..."
2021-04-08 20:20:10 +02:00
# Remove borg if we are removing the last borg app on the system
if [ "$(yunohost app list | grep "id: borg" | wc -l)" == "1" ] ; then
ynh_secure_remove "/opt/borg-env"
ynh_secure_remove "/usr/local/bin/borg"
fi
#=================================================
2021-04-08 20:20:10 +02:00
# REMOVE USER BUT KEEP FILES
#=================================================
2021-04-08 20:20:10 +02:00
# We keep files cause we don't know what the user want to do about
# backups stored in the home directory
2023-10-25 21:57:09 +02:00
ynh_system_user_delete --username=$ssh_user
2021-04-08 20:20:10 +02:00
#=================================================
# REMOVE CRON FILES
#=================================================
2023-10-25 21:57:09 +02:00
2021-04-08 20:20:10 +02:00
ynh_secure_remove "/etc/cron.d/$app"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last