2016-08-15 15:38:50 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-02-08 17:25:54 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
|
2018-02-07 00:31:25 +01:00
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
source /usr/share/yunohost/helpers
|
2017-04-05 21:06:22 +02:00
|
|
|
|
2016-08-15 15:38:50 +02:00
|
|
|
# Load common variables and helpers
|
|
|
|
source ./_common.sh
|
|
|
|
|
2018-02-08 17:25:54 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
2016-08-15 15:38:50 +02:00
|
|
|
|
|
|
|
# Stop gogs
|
2018-02-07 00:31:25 +01:00
|
|
|
systemctl stop "$app".service
|
2016-08-15 15:38:50 +02:00
|
|
|
|
|
|
|
# Drop MySQL database and user
|
2018-02-07 00:31:25 +01:00
|
|
|
ynh_mysql_drop_db "$dbname" 2>/dev/null
|
|
|
|
ynh_mysql_drop_user "$dbuser" 2>/dev/null
|
2016-08-15 15:38:50 +02:00
|
|
|
|
|
|
|
# Retrieve domain from app settings
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
|
|
|
|
# Delete app directory and configurations
|
2018-02-08 11:42:15 +01:00
|
|
|
ynh_secure_remove "$final_path"
|
|
|
|
ynh_secure_remove "$DATADIR"
|
2018-02-07 00:31:25 +01:00
|
|
|
ynh_secure_remove "/var/log/$app"
|
|
|
|
|
|
|
|
# Remove the app-specific logrotate config
|
|
|
|
ynh_remove_logrotate
|
|
|
|
|
|
|
|
# Remove nginx config
|
|
|
|
ynh_remove_nginx_config
|
2016-08-15 15:38:50 +02:00
|
|
|
|
|
|
|
# Remove gogs user and data
|
2018-02-07 00:31:25 +01:00
|
|
|
ynh_system_user_delete $app
|
2016-08-15 15:38:50 +02:00
|
|
|
|
|
|
|
# Remove init script
|
2018-02-07 00:31:25 +01:00
|
|
|
ynh_remove_systemd_config
|
2016-08-15 15:38:50 +02:00
|
|
|
|
|
|
|
# Remove monitor
|
2018-02-08 17:25:54 +01:00
|
|
|
yunohost service remove "$app"
|