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

86 lines
2.2 KiB
Text
Raw Normal View History

2017-06-10 10:10:31 +02:00
#!/bin/bash
2018-12-19 00:02:20 +01:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2017-06-10 10:10:31 +02:00
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Load common variables and helpers
source ./_common.sh
2017-06-10 10:10:31 +02:00
2018-12-19 00:02:20 +01:00
#=================================================
# LOAD SETTINGS
#=================================================
# See comments in install script
app=$YNH_APP_INSTANCE_NAME
2018-12-19 00:48:27 +01:00
domain=$(ynh_app_setting_get "$app" domain)
2018-12-19 00:02:20 +01:00
port=$(ynh_app_setting_get "$app" web_port)
portUnicorn=$(ynh_app_setting_get "$app" unicorn_port)
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE GITLAB
#=================================================
2019-01-26 14:30:58 +01:00
ynh_print_info "Removing Gitlab..."
# Remove gitlab
dpkg --remove gitlab-ce
2017-06-29 21:39:47 +02:00
2018-12-19 00:02:20 +01:00
#=================================================
# REMOVE CONF GILE
#=================================================
# Remove Config
remove_config_gitlab
2017-06-29 21:39:47 +02:00
2018-12-19 00:02:20 +01:00
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_remove_app_dependencies
2017-06-10 10:10:31 +02:00
2018-12-19 00:02:20 +01:00
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_secure_remove "$final_path"
ynh_secure_remove "$config_path"
ynh_secure_remove "/var/opt/$app"
2017-06-10 10:10:31 +02:00
# Remove the log files
ynh_secure_remove "/var/log/$app"
2017-06-10 10:10:31 +02:00
2018-12-19 00:02:20 +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 "\- $portUnicorn$"
then
echo "Close port $portUnicorn" >&2
yunohost firewall disallow TCP $portUnicorn 2>&1
fi
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_remove_nginx_config
2018-12-19 00:02:20 +01:00
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
#ynh_remove_logrotate