2013-12-12 12:12:22 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-10-30 17:52:57 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
|
2019-11-01 22:04:11 +01:00
|
|
|
# Source YunoHost helpers
|
2017-10-30 17:52:57 +01:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2019-11-01 22:04:11 +01:00
|
|
|
# Stop script if errors
|
|
|
|
set -u
|
2017-10-30 17:52:57 +01:00
|
|
|
|
2019-11-01 22:04:11 +01:00
|
|
|
# Import common cmd
|
|
|
|
source ./experimental_helper.sh
|
|
|
|
source ./_common.sh
|
2017-10-30 17:52:57 +01:00
|
|
|
|
2019-11-01 22:04:11 +01:00
|
|
|
# LOAD SETTINGS
|
|
|
|
ynh_script_progression --message="Loading installation settings..."
|
|
|
|
domain=$(ynh_app_setting_get --app $app --key domain)
|
|
|
|
final_path=$(ynh_app_setting_get --app $app --key final_path)
|
2017-10-30 17:52:57 +01:00
|
|
|
db_user=$app
|
|
|
|
db_name=$app
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
|
2019-11-01 22:04:11 +01:00
|
|
|
# REMOVE UWSGI
|
|
|
|
ynh_script_progression --message="Removing configuration..."
|
2018-07-05 23:21:03 +02:00
|
|
|
ynh_remove_uwsgi_service
|
2017-10-30 17:52:57 +01:00
|
|
|
|
|
|
|
# REMOVE DEPENDENCIES
|
2019-11-01 22:04:11 +01:00
|
|
|
ynh_script_progression --message="Removing dependencies" --weight=10
|
2017-10-30 17:52:57 +01:00
|
|
|
ynh_remove_app_dependencies
|
|
|
|
|
|
|
|
# REMOVE THE MYSQL DATABASE
|
2019-11-01 22:04:11 +01:00
|
|
|
ynh_script_progression --message="Removing databases..."
|
|
|
|
ynh_mysql_remove_db --db_user "$db_user" --db_name "$db_name"
|
2017-10-30 17:52:57 +01:00
|
|
|
|
|
|
|
# REMOVE APP MAIN DIR
|
2019-11-01 22:04:11 +01:00
|
|
|
ynh_script_progression --message="Backing up the main app directory..."
|
|
|
|
ynh_secure_remove --file="$final_path"
|
2017-10-30 17:52:57 +01:00
|
|
|
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
2019-11-01 22:04:11 +01:00
|
|
|
ynh_script_progression --message="Removing nginx configuration"
|
2017-10-30 17:52:57 +01:00
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
|
|
|
# Delete a system user
|
2019-11-01 22:04:11 +01:00
|
|
|
ynh_script_progression --message="Removing user..."
|
|
|
|
ynh_system_user_delete --username "$app"
|
|
|
|
|
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|