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
2019-01-19 01:18:34 +01:00

93 lines
No EOL
2.5 KiB
Bash

#!/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)
port_http_proxy=$(ynh_app_setting_get "$app" port_http_proxy)
#=================================================
# STANDARD REMOVE
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
# 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
#=================================================
# 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
ynh_secure_remove "/var/log/$app.log"
#=================================================
# 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
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
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_remove_nginx_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
#ynh_remove_logrotate