#!/bin/bash #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= ynh_script_progression --message="Loading installation settings..." --time app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app="$app" --key=domain) port=$(ynh_app_setting_get --app="$app" --key=web_port) portUnicorn=$(ynh_app_setting_get --app="$app" --key=unicorn_port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) config_path=$(ynh_app_setting_get --app=$app --key=config_path) #================================================= # STANDARD REMOVE #================================================= # REMOVE SERVICE FROM ADMIN PANEL #================================================= if yunohost service status "gitlab-runsvdir" >/dev/null 2>&1 then ynh_script_progression --message="Removing $app service" --time yunohost service remove "gitlab-runsvdir" fi #================================================= # STOP GITLAB #================================================= ynh_script_progression --message="Stopping gitlab" --time gitlab-ctl stop #================================================= # REMOVE GITLAB #================================================= ynh_script_progression --message="Removing Gitlab" --time dpkg --remove gitlab-ce #================================================= # REMOVE DEPENDENCIES #================================================= ynh_script_progression --message="Removing dependencies" --time # Remove metapackage and its dependencies ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= ynh_script_progression --message="Removing app main directory" --time # Remove the app directory securely ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$config_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= ynh_script_progression --message="Removing nginx web server configuration" --time # Remove the dedicated nginx config ynh_remove_nginx_config #================================================= # CLOSE A PORT #================================================= # These ports are no longer open but were in previous versions if yunohost firewall list | grep -q "\- $port$"; then ynh_script_progression --message="Closing port $port" --time ynh_exec_warn_less yunohost firewall disallow TCP $port fi if yunohost firewall list | grep -q "\- $portUnicorn$"; then ynh_script_progression --message="Closing port $portUnicorn" --time ynh_exec_warn_less yunohost firewall disallow TCP $portUnicorn fi #================================================= # SPECIFIC REMOVE #================================================= # REMOVE GITLAB FILES #================================================= ynh_secure_remove --file="/var/opt/$app" # Remove the log files ynh_secure_remove --file="/var/log/$app" #================================================= # END OF SCRIPT #================================================= ynh_script_progression --message="Removal of $app completed" --time --last