2014-12-09 21:00:17 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
2021-02-25 23:05:04 +01:00
|
|
|
# GENERIC START
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2014-12-09 21:00:17 +01:00
|
|
|
|
2017-03-19 22:50:12 +01:00
|
|
|
source _common.sh
|
2016-11-30 17:49:37 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2019-05-28 00:28:01 +02:00
|
|
|
ynh_script_progression --message="Loading installation settings..." --weight=4
|
2017-03-19 18:28:38 +01:00
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
2019-05-28 00:28:01 +02:00
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
2021-03-03 20:50:33 +01:00
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
2016-11-30 17:55:46 +01:00
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
2021-02-25 23:05:04 +01:00
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
2016-11-30 17:49:37 +01:00
|
|
|
|
2021-01-06 14:47:04 +01:00
|
|
|
# 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
|
2016-11-30 17:49:37 +01:00
|
|
|
then
|
2021-01-22 12:48:14 +01:00
|
|
|
ynh_script_progression --message="Removing $app service integration..." --weight=1
|
2017-09-05 00:20:40 +02:00
|
|
|
yunohost service remove $app
|
2016-11-30 17:49:37 +01:00
|
|
|
fi
|
|
|
|
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
2021-03-01 22:09:37 +01:00
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Stopping a systemd service..."
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --line_match="Stopped LSB" --log_path="systemd"
|
|
|
|
|
|
|
|
#=================================================
|
2017-03-19 18:28:38 +01:00
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
2019-05-28 00:28:01 +02:00
|
|
|
ynh_script_progression --message="Removing dependencies..." --weight=20
|
2017-03-19 18:28:38 +01:00
|
|
|
|
2019-01-13 18:07:28 +01:00
|
|
|
# Remove metapackage and its dependencies
|
2021-03-04 00:37:08 +01:00
|
|
|
ynh_package_autopurge $app
|
2017-03-19 18:28:38 +01:00
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
|
|
|
#=================================================
|
2021-02-25 23:05:04 +01:00
|
|
|
# REMOVE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removing app main directory..."
|
|
|
|
|
|
|
|
# Remove the app directory securely
|
|
|
|
ynh_secure_remove --file="$final_path"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
2017-03-19 18:28:38 +01:00
|
|
|
#=================================================
|
2020-12-03 18:24:29 +01:00
|
|
|
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=2
|
2016-11-30 17:49:37 +01:00
|
|
|
|
2020-12-03 18:24:29 +01:00
|
|
|
# Remove the dedicated NGINX config
|
2019-01-13 18:07:28 +01:00
|
|
|
ynh_remove_nginx_config
|
2019-01-30 15:56:18 +01:00
|
|
|
|
2021-03-04 00:37:08 +01:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC REMOVE
|
|
|
|
#=================================================
|
|
|
|
# REMOVE VARIOUS FILES
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removing various files..."
|
|
|
|
|
|
|
|
# Remove a directory securely
|
|
|
|
ynh_secure_remove --file="/etc/default/jenkins"
|
|
|
|
|
|
|
|
# Remove the log files
|
|
|
|
ynh_secure_remove --file="/var/log/$app"
|
|
|
|
|
2019-01-30 15:56:18 +01:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2019-05-28 00:28:01 +02:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|