1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/opennote_ynh.git synced 2024-09-03 19:46:28 +02:00
opennote_ynh/scripts/remove

57 lines
1.9 KiB
Text
Raw Normal View History

2016-06-27 10:27:19 +02:00
#!/bin/bash
2020-10-13 23:38:00 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2016-06-27 10:27:19 +02:00
2020-10-13 23:38:00 +02:00
source _common.sh
2016-06-27 10:27:19 +02:00
source /usr/share/yunohost/helpers
2020-10-13 23:38:00 +02:00
#=================================================
# LOAD SETTINGS
#=================================================
2020-11-07 19:15:46 +01:00
ynh_script_progression --message="Loading installation settings..." --weight=1
2020-10-13 23:38:00 +02:00
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
# Remove the service from the list of services known by Yunohost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null
then
2020-11-07 19:15:46 +01:00
ynh_script_progression --message="Removing $app service integration..." --weight=2
2020-10-13 23:38:00 +02:00
yunohost service remove $app
fi
#=================================================
# REMOVE APP MAIN DIR
#=================================================
2020-11-07 19:15:46 +01:00
ynh_script_progression --message="Removing app main directory..." --weight=2
2020-10-13 23:38:00 +02:00
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
2020-11-07 19:15:46 +01:00
ynh_script_progression --message="Removing nginx web server configuration..." --weight=1
2020-10-13 23:38:00 +02:00
# Remove the dedicated nginx config
ynh_remove_nginx_config
2016-06-27 10:27:19 +02:00
2020-10-13 23:38:00 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2016-06-27 10:27:19 +02:00
2020-10-13 23:38:00 +02:00
ynh_script_progression --message="Removal of $app completed" --last