2015-05-31 13:46:25 +02:00
|
|
|
#!/bin/bash
|
2018-03-13 21:49:11 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2017-02-02 03:37:01 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
source _common.sh
|
2015-05-31 13:46:25 +02:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
|
2017-02-02 03:37:01 +01:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2018-03-13 21:49:11 +01:00
|
|
|
|
|
|
|
final_path=$(ynh_app_setting_get $app final_path)
|
|
|
|
final_path=${final_path:-/var/www/$app}
|
2017-02-02 03:37:01 +01:00
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
2018-03-13 21:49:11 +01:00
|
|
|
db_name=$(ynh_app_setting_get $app db_name)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Remove metapackage and its dependencies
|
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE SQL BDD
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Remove a database if it exists, along with the associated user
|
|
|
|
ynh_mysql_remove_db $db_name $db_name
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE THE MAIN DIR OF THE APP
|
|
|
|
#=================================================
|
2017-02-02 03:37:01 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
# Remove the app directory securely
|
|
|
|
ynh_secure_remove "$final_path"
|
|
|
|
ynh_secure_remove "/home/yunohost.app/$app"
|
2017-02-05 22:45:48 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2017-02-02 03:37:01 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
# Remove the dedicated nginx config
|
|
|
|
ynh_remove_nginx_config
|
2017-02-05 22:45:48 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE THE PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
2017-02-05 22:45:48 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
# Remove the dedicated php-fpm config
|
|
|
|
ynh_remove_fpm_config
|
2017-02-05 22:45:48 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
2017-02-05 23:38:38 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
# Delete a system user
|
|
|
|
ynh_system_user_delete $app
|