2016-03-18 18:38:54 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
2016-03-18 18:38:54 +01:00
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
2016-03-18 18:38:54 +01:00
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
# Import common cmd
|
|
|
|
source ./experimental_helper.sh
|
|
|
|
source ./_common.sh
|
2016-03-18 18:38:54 +01:00
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
# Retrieve app settings
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2016-03-18 18:38:54 +01:00
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
port=$(ynh_app_setting_get $app port)
|
|
|
|
db_name=$(ynh_app_setting_get $app db_name)
|
|
|
|
db_user=$(ynh_app_setting_get $app db_user)
|
|
|
|
final_path=$(ynh_app_setting_get $app final_path)
|
2016-03-18 21:00:30 +01:00
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
2016-03-18 21:00:30 +01:00
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
# Remove metapackage and its dependencies
|
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
|
|
|
# Remove a database if it exists, along with the associated user
|
|
|
|
ynh_mysql_remove_db $db_user $db_name
|
|
|
|
|
|
|
|
# Remove the app directory securely
|
|
|
|
ynh_secure_remove "$final_path"
|
|
|
|
|
|
|
|
# Remove sogo config
|
|
|
|
ynh_secure_remove "/etc/$app"
|
|
|
|
|
|
|
|
# Remove stunnel config
|
|
|
|
ynh_secure_remove "/etc/stunnel/$app.conf"
|
|
|
|
|
|
|
|
# Remove the app-specific logrotate config
|
|
|
|
ynh_remove_logrotate
|