mirror of
https://github.com/YunoHost-Apps/ffsync_ynh.git
synced 2024-09-03 18:26:38 +02:00
52 lines
1.4 KiB
Bash
52 lines
1.4 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
|
|
# Source YunoHost helpers
|
|
source /usr/share/yunohost/helpers
|
|
|
|
# Stop script if errors
|
|
set -u
|
|
|
|
# Import common cmd
|
|
source ./experimental_helper.sh
|
|
source ./_common.sh
|
|
|
|
# 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)
|
|
db_user=$app
|
|
db_name=$app
|
|
|
|
#=================================================
|
|
# STANDARD REMOVE
|
|
#=================================================
|
|
|
|
# REMOVE UWSGI
|
|
ynh_script_progression --message="Removing configuration..."
|
|
ynh_remove_uwsgi_service
|
|
|
|
# REMOVE DEPENDENCIES
|
|
ynh_script_progression --message="Removing dependencies" --weight=10
|
|
ynh_remove_app_dependencies
|
|
|
|
# REMOVE THE MYSQL DATABASE
|
|
ynh_script_progression --message="Removing databases..."
|
|
ynh_mysql_remove_db --db_user "$db_user" --db_name "$db_name"
|
|
|
|
# REMOVE APP MAIN DIR
|
|
ynh_script_progression --message="Backing up the main app directory..."
|
|
ynh_secure_remove --file="$final_path"
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
ynh_script_progression --message="Removing nginx configuration"
|
|
ynh_remove_nginx_config
|
|
|
|
# Delete a system user
|
|
ynh_script_progression --message="Removing user..."
|
|
ynh_system_user_delete --username "$app"
|
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|