yunohost-gitea_ynh/scripts/remove

52 lines
1.2 KiB
Plaintext
Raw Normal View History

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
2019-06-09 21:05:14 +02:00
domain=$(ynh_app_setting_get --app $app --key domain)
2018-02-25 21:45:24 +01:00
# Delete app directory and configurations
2019-06-09 21:05:14 +02:00
ynh_secure_remove --file="$final_path"
ynh_secure_remove --file="$DATADIR"
ynh_secure_remove --file="/var/log/$app"
2018-02-25 21:45:24 +01:00
# 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
yunohost service remove "$app"
2019-08-01 15:06:04 +02:00
# Remove fail2ban config
ynh_remove_fail2ban_config
true # Do not fail if remove after install error