2021-04-01 12:47:58 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2021-04-01 13:03:13 +02:00
|
|
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
2021-04-01 12:47:58 +02:00
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE APP MAIN DIR
|
|
|
|
#=================================================
|
2021-04-01 13:03:13 +02:00
|
|
|
ynh_script_progression --message="Removing app main directory..." --weight=1
|
2021-04-01 12:47:58 +02:00
|
|
|
|
|
|
|
# Remove the app directory securely
|
|
|
|
ynh_secure_remove --file="$final_path"
|
|
|
|
|
2021-06-08 10:37:27 +02:00
|
|
|
# Remove the content directory securely
|
|
|
|
#ynh_secure_remove --file="/home/yunohost.app/$app"
|
2022-02-23 16:43:10 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE DATA DIR
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Remove the data directory if --purge option is used
|
|
|
|
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
|
|
|
|
then
|
|
|
|
ynh_script_progression --message="Removing app data directory..." --time --weight=1
|
|
|
|
ynh_secure_remove --file="$datadir"
|
|
|
|
fi
|
2021-06-08 10:37:27 +02:00
|
|
|
|
2021-04-01 12:47:58 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2021-04-01 13:03:13 +02:00
|
|
|
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
|
2021-04-01 12:47:58 +02:00
|
|
|
|
|
|
|
# Remove the dedicated NGINX config
|
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
2021-04-01 13:03:13 +02:00
|
|
|
ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1
|
2021-04-01 12:47:58 +02:00
|
|
|
|
|
|
|
# Remove the dedicated PHP-FPM config
|
|
|
|
ynh_remove_fpm_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
2021-04-01 13:03:13 +02:00
|
|
|
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
|
2021-04-01 12:47:58 +02:00
|
|
|
|
|
|
|
# Delete a system user
|
|
|
|
ynh_system_user_delete --username=$app
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-04-01 13:03:13 +02:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|