1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/archivist_ynh.git synced 2024-09-03 18:15:55 +02:00
archivist_ynh/scripts/remove
2019-01-30 16:07:38 +01:00

65 lines
1.9 KiB
Bash
Executable file

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Load settings" --weight=2
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get $app final_path)
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Remove dependencies" --weight=7
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Remove app main directory"
# Remove the app directory securely
ynh_secure_remove "$final_path"
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Remove logrotate configuration"
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE THE CRON FILE
#=================================================
# Remove a cron file
ynh_secure_remove "/etc/cron.d/$app"
ynh_script_progression --message="Remove backup directory" --weight=5
# Remove the backup directory
ynh_secure_remove "/home/yunohost.app/${app}/backup"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Deletion completed" --last