1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gogs_ynh.git synced 2024-09-03 20:36:23 +02:00
gogs_ynh/scripts/remove

43 lines
856 B
Text
Raw Normal View History

2016-08-15 15:38:50 +02:00
#!/bin/bash
# IMPORT GENERIC HELPERS
source /usr/share/yunohost/helpers
2016-08-15 15:38:50 +02:00
# Load common variables and helpers
source ./experimental_helper.sh
2016-08-15 15:38:50 +02:00
source ./_common.sh
# Set app specific variables
app=$YNH_APP_INSTANCE_NAME
2016-08-15 15:38:50 +02:00
dbname=$app
dbuser=$app
# Stop gogs
systemctl stop "$app".service
2016-08-15 15:38:50 +02:00
# Drop MySQL database and user
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
ynh_secure_remove "/opt/${app}"
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
ynh_system_user_delete $app
2016-08-15 15:38:50 +02:00
# Remove init script
ynh_remove_systemd_config
2016-08-15 15:38:50 +02:00
# Remove monitor
yunohost service remove "$app"