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-01-30 16:07:38 +01:00
|
|
|
ynh_script_progression --message="Load settings" --weight=2
|
2017-11-01 20:57:58 +01:00
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
final_path=$(ynh_app_setting_get $app final_path)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
2019-01-30 16:07:38 +01:00
|
|
|
ynh_script_progression --message="Remove 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-01-30 16:07:38 +01:00
|
|
|
ynh_script_progression --message="Remove app main directory"
|
2017-11-01 20:57:58 +01:00
|
|
|
|
|
|
|
# Remove the app directory securely
|
|
|
|
ynh_secure_remove "$final_path"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE LOGROTATE CONFIGURATION
|
|
|
|
#=================================================
|
2019-01-30 16:07:38 +01:00
|
|
|
ynh_script_progression --message="Remove 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
|
|
|
|
ynh_secure_remove "/etc/cron.d/$app"
|
|
|
|
|
2019-01-30 16:07:38 +01:00
|
|
|
ynh_script_progression --message="Remove backup directory" --weight=5
|
|
|
|
|
2017-11-01 20:57:58 +01:00
|
|
|
# Remove the backup directory
|
2017-11-03 01:11:50 +01:00
|
|
|
ynh_secure_remove "/home/yunohost.app/${app}/backup"
|
2019-01-30 16:07:38 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Deletion completed" --last
|