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
Pierre Bourré 2c14e80a2b format files
2019-01-26 14:46:52 +01:00

84 lines
2.2 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" web_port)
portUnicorn=$(ynh_app_setting_get "$app" unicorn_port)
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE GITLAB
#=================================================
ynh_print_info "Removing Gitlab..."
# Remove gitlab
dpkg --remove gitlab-ce
#=================================================
# REMOVE CONF GILE
#=================================================
# Remove Config
remove_config_gitlab
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_secure_remove "$final_path"
ynh_secure_remove "$config_path"
ynh_secure_remove "/var/opt/$app"
# Remove the log files
ynh_secure_remove "/var/log/$app"
#=================================================
# 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
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
#ynh_remove_logrotate