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

93 lines
2.5 KiB
Text
Raw Normal View History

2018-12-28 21:59:37 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Load common variables and helpers
source ./_common.sh
#=================================================
# LOAD SETTINGS
#=================================================
# See comments in install script
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get "$app" domain)
port=$(ynh_app_setting_get "$app" port)
port_hub=$(ynh_app_setting_get "$app" port_hub)
2019-01-19 01:18:34 +01:00
port_http_proxy=$(ynh_app_setting_get "$app" port_http_proxy)
2018-12-28 21:59:37 +01:00
#=================================================
# STANDARD REMOVE
#=================================================
2018-12-30 16:00:54 +01:00
# STOP AND REMOVE SERVICE
2018-12-28 21:59:37 +01:00
#=================================================
2018-12-30 16:00:54 +01:00
# Remove the dedicated systemd config
ynh_remove_systemd_config
#=================================================
# REMOVE SERVICE FROM ADMIN PANEL
#=================================================
# Remove a service from the admin panel, added by `yunohost service add`
if yunohost service status | grep -q $app
then
echo "Remove $app service"
yunohost service remove $app
fi
2018-12-28 21:59:37 +01:00
#=================================================
# REMOVE CONF FILE
#=================================================
# Remove Config
remove_config_jupyterlab
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_secure_remove "$final_path"
ynh_secure_remove "$config_path"
# Remove the log files
2018-12-30 16:00:54 +01:00
ynh_secure_remove "/var/log/$app.log"
2018-12-28 21:59:37 +01:00
#=================================================
# CLOSE PORTS
#=================================================
if yunohost firewall list | grep -q "\- $port$"
then
echo "Close port $port" >&2
yunohost firewall disallow TCP $port 2>&1
fi
if yunohost firewall list | grep -q "\- $port_hub$"
then
echo "Close port $port_hub" >&2
yunohost firewall disallow TCP $port_hub 2>&1
fi
2019-01-19 01:18:34 +01:00
if yunohost firewall list | grep -q "\- $port_http_proxy$"
then
echo "Close port $port_http_proxy" >&2
yunohost firewall disallow TCP $port_http_proxy 2>&1
fi
2018-12-28 21:59:37 +01:00
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_remove_nginx_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
#ynh_remove_logrotate