2016-10-05 19:44:08 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-02-12 21:53:49 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2016-10-05 19:44:08 +02:00
|
|
|
|
2018-02-12 21:53:49 +01:00
|
|
|
source _common.sh
|
2016-10-05 19:44:08 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2018-02-12 21:53:49 +01:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2016-10-05 19:44:08 +02:00
|
|
|
|
2018-02-12 21:53:49 +01:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
db_name=$(ynh_app_setting_get $app db_name)
|
|
|
|
db_user=$db_name
|
|
|
|
final_path=$(ynh_app_setting_get $app final_path)
|
2018-02-12 16:07:11 +01:00
|
|
|
|
2018-02-12 21:53:49 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE THE MYSQL DATABASE
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Remove a database if it exists, along with the associated user
|
|
|
|
ynh_mysql_remove_db $db_user $db_name
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Remove the app directory securely
|
|
|
|
ynh_secure_remove "$final_path"
|
2018-02-12 16:07:11 +01:00
|
|
|
ynh_secure_remove "/tmp/$app"
|
2016-10-05 19:44:08 +02:00
|
|
|
|
2018-02-12 21:53:49 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Remove the dedicated nginx config
|
2018-02-12 16:07:11 +01:00
|
|
|
ynh_remove_nginx_config
|
2018-02-12 21:53:49 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Remove the dedicated php-fpm config
|
2018-02-12 16:07:11 +01:00
|
|
|
ynh_remove_fpm_config
|
2018-02-12 21:53:49 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE LOGROTATE CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Remove the app-specific logrotate config
|
|
|
|
ynh_remove_logrotate
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Delete a system user
|
|
|
|
ynh_system_user_delete $app
|