1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cryptpad_ynh.git synced 2024-09-03 18:26:14 +02:00
cryptpad_ynh/scripts/remove

82 lines
2.7 KiB
Text
Raw Normal View History

2017-04-08 00:06:50 +02:00
#!/bin/bash
2018-05-04 11:47:06 +02:00
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
2018-05-04 11:47:06 +02:00
#=================================================
# LOAD SETTINGS
#=================================================
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
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
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
2018-05-04 11:47:06 +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
yunohost service remove $app
fi
2017-04-08 00:06:50 +02:00
2018-05-04 11:47:06 +02:00
#=================================================
# STOP AND REMOVE SERVICE
2018-05-04 11:47:06 +02:00
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2
# 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
#=================================================
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
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
#=================================================
# GENERIC FINALIZATION
2018-05-04 11:47:06 +02:00
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
2018-05-04 11:47:06 +02:00
# Delete a system user
ynh_system_user_delete --username=$app
2018-05-04 11:47:06 +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