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

66 lines
2 KiB
Text
Raw Normal View History

2017-11-01 20:57:58 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
2019-05-26 17:00:09 +02:00
ynh_script_progression --message="Loading installation settings..." --weight=2
2017-11-01 20:57:58 +01:00
app=$YNH_APP_INSTANCE_NAME
2019-05-26 17:00:09 +02:00
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
2017-11-01 20:57:58 +01:00
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE DEPENDENCIES
#=================================================
2019-05-26 17:00:09 +02:00
ynh_script_progression --message="Removing dependencies..." --weight=7
2017-11-01 20:57:58 +01:00
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
2019-05-26 17:00:09 +02:00
ynh_script_progression --message="Removing app main directory..."
2017-11-01 20:57:58 +01:00
# Remove the app directory securely
2019-05-26 17:00:09 +02:00
ynh_secure_remove --file="$final_path"
2017-11-01 20:57:58 +01:00
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
2019-05-26 17:00:09 +02:00
ynh_script_progression --message="Removing logrotate configuration..."
2017-11-01 20:57:58 +01:00
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE THE CRON FILE
#=================================================
# Remove a cron file
2019-05-26 17:00:09 +02:00
ynh_secure_remove --file="/etc/cron.d/$app"
2017-11-01 20:57:58 +01:00
2019-05-26 17:00:09 +02:00
ynh_script_progression --message="Removing backup directory..." --weight=5
2019-01-30 16:07:38 +01:00
2017-11-01 20:57:58 +01:00
# Remove the backup directory
2019-05-26 17:00:09 +02:00
ynh_secure_remove --file="/home/yunohost.app/$app/backup"
2019-01-30 16:07:38 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2019-05-26 17:00:09 +02:00
ynh_script_progression --message="Removal of $app completed" --last