2017-04-08 00:06:50 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2017-07-23 00:14:35 +02:00
|
|
|
|
2017-07-23 17:46:25 +02:00
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
2018-05-04 11:47:06 +02:00
|
|
|
|
2017-04-08 00:06:50 +02:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2020-07-18 11:46:45 +02:00
|
|
|
|
|
|
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
|
2020-07-18 11:46:45 +02:00
|
|
|
# Remove the service from the list of services known by Yunohost (added from `yunohost service add`)
|
|
|
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
|
|
|
then
|
2020-10-13 13:52:56 +02:00
|
|
|
ynh_script_progression --message="Removing CryptPad service..." --weight=3
|
2020-07-18 11:46:45 +02:00
|
|
|
yunohost service remove $app
|
|
|
|
fi
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
# STOP AND REMOVE SERVICE
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2
|
2017-07-30 21:33:54 +02:00
|
|
|
|
2020-07-18 11:46:45 +02:00
|
|
|
# Remove the dedicated systemd config
|
|
|
|
ynh_remove_systemd_config
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE NODEJS
|
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
ynh_script_progression --message="Removing dependencies..." --weight=3
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
ynh_remove_nodejs
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
2019-01-05 20:42:54 +01:00
|
|
|
# REMOVE APP MAIN DIR
|
|
|
|
#=================================================
|
2020-10-13 13:52:56 +02:00
|
|
|
ynh_script_progression --message="Removing CryptPad main directory..." --weight=3
|
2019-01-05 20:42:54 +01:00
|
|
|
|
|
|
|
# Remove the app directory securely
|
2020-07-18 11:46:45 +02:00
|
|
|
ynh_secure_remove --file="$final_path"
|
2019-01-05 20:42:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
2020-10-13 13:52:56 +02:00
|
|
|
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2020-10-13 13:52:56 +02:00
|
|
|
# Remove the dedicated NGINX config
|
2019-01-05 20:42:54 +01:00
|
|
|
ynh_remove_nginx_config
|
2018-05-04 11:47:06 +02:00
|
|
|
|
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
# GENERIC FINALIZATION
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
# REMOVE DEDICATED USER
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
|
2018-05-04 11:47:06 +02:00
|
|
|
|
2020-07-18 11:46:45 +02:00
|
|
|
# Delete a system user
|
|
|
|
ynh_system_user_delete --username=$app
|
2018-05-04 11:47:06 +02:00
|
|
|
|
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
# END OF SCRIPT
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
|
2020-10-13 13:52:56 +02:00
|
|
|
ynh_script_progression --message="Removal of CryptPad completed" --last
|