2020-05-08 20:42:27 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removing dependencies..." --time --weight=1
|
|
|
|
|
|
|
|
# Remove metapackage and its dependencies
|
2021-02-20 19:31:31 +01:00
|
|
|
#ynh_remove_app_dependencies
|
|
|
|
#ynh_use_nodejs
|
|
|
|
#ynh_npm uninstall -g coffeescript
|
2021-04-25 16:50:33 +02:00
|
|
|
ynh_use_nodejs
|
|
|
|
ynh_npm uninstall -g coffeescript
|
|
|
|
ynh_remove_nodejs
|
2021-05-09 11:52:48 +02:00
|
|
|
ynh_remove_app_dependencies
|
2020-05-08 20:42:27 +02:00
|
|
|
|
2021-05-09 11:52:48 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE CRONJOB
|
|
|
|
#=================================================
|
|
|
|
|
2021-05-09 14:04:51 +02:00
|
|
|
ynh_secure_remove --file="/etc/cron.d/$app"
|
2021-02-20 19:31:31 +01:00
|
|
|
|
2020-05-08 20:42:27 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removing app main directory..." --time --weight=1
|
|
|
|
|
|
|
|
# Remove the app directory securely
|
|
|
|
ynh_secure_remove --file="$final_path"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1
|
|
|
|
|
|
|
|
# Remove the dedicated nginx config
|
|
|
|
ynh_remove_nginx_config
|
2021-02-20 19:31:31 +01:00
|
|
|
if [ "$(ynh_app_setting_get --app=$app --key=checksum__etc_nginx_mime.types)" == "$(md5sum "/etc/nginx/mime.types" | cut -d ' ' -f 1)" ]; then
|
|
|
|
#file has not changed, restore the previous mime.type
|
|
|
|
rm /etc/nginx/mime.types
|
|
|
|
mv /etc/nginx/mime.types.$app /etc/nginx/mime.types
|
|
|
|
else
|
|
|
|
#keep the actual mime.type and warn
|
|
|
|
ynh_print_warn "/etc/nginx/mime.types has changed! Keeping current file!"
|
|
|
|
fi
|
2020-05-08 20:42:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-05-09 14:04:51 +02:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --time --last
|