2018-02-25 21:45:24 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
# Load common variables and helpers
|
|
|
|
source ./experimental_helper.sh
|
|
|
|
source ./_common.sh
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
|
2019-02-14 09:58:05 +01:00
|
|
|
# Stop gitea
|
2018-02-25 21:45:24 +01:00
|
|
|
systemctl stop "$app".service
|
|
|
|
|
|
|
|
# Drop MySQL database and user
|
|
|
|
ynh_mysql_drop_db "$dbname" 2>/dev/null
|
|
|
|
ynh_mysql_drop_user "$dbuser" 2>/dev/null
|
|
|
|
|
|
|
|
# Retrieve domain from app settings
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
|
|
|
|
# Delete app directory and configurations
|
|
|
|
ynh_secure_remove "$final_path"
|
|
|
|
ynh_secure_remove "$DATADIR"
|
|
|
|
ynh_secure_remove "/var/log/$app"
|
|
|
|
|
|
|
|
# Remove the app-specific logrotate config
|
|
|
|
ynh_remove_logrotate
|
|
|
|
|
|
|
|
# Remove nginx config
|
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
2019-02-14 09:58:05 +01:00
|
|
|
# Remove gitea user and data
|
2018-02-25 21:45:24 +01:00
|
|
|
ynh_system_user_delete $app
|
|
|
|
|
|
|
|
# Remove init script
|
|
|
|
ynh_remove_systemd_config
|
|
|
|
|
|
|
|
# Remove monitor
|
2018-06-12 14:32:44 +02:00
|
|
|
yunohost service remove "$app"
|
|
|
|
|
|
|
|
true # Do not fail if remove after install error
|