1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/haste_ynh.git synced 2024-09-03 20:36:28 +02:00
haste_ynh/scripts/remove

86 lines
2.2 KiB
Text
Raw Normal View History

2016-10-25 00:00:01 +02:00
#!/bin/bash
2017-10-14 14:38:56 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2016-10-25 00:00:01 +02:00
2017-10-14 14:38:56 +02:00
source _common.sh
source /usr/share/yunohost/helpers
2016-10-25 00:00:01 +02:00
2017-10-14 14:38:56 +02:00
#=================================================
# LOAD SETTINGS
#=================================================
2016-10-25 00:00:01 +02:00
2017-10-14 14:38:56 +02:00
app=$YNH_APP_INSTANCE_NAME
2016-10-25 00:00:01 +02:00
2017-10-14 14:38:56 +02:00
domain=$(ynh_app_setting_get $app domain)
final_path=$(ynh_app_setting_get $app final_path)
2016-10-25 00:00:01 +02:00
2017-10-14 14:38:56 +02:00
#=================================================
# STANDARD REMOVE
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
2016-10-25 00:00:01 +02:00
2017-10-14 14:38:56 +02:00
# Remove the dedicated systemd config
ynh_remove_systemd_config
2016-10-25 00:00:01 +02:00
2017-10-14 14:38:56 +02:00
#=================================================
# REMOVE SERVICE FROM ADMIN PANEL
#=================================================
2016-10-25 00:00:01 +02:00
2017-10-14 14:38:56 +02:00
if yunohost service status | grep -q $app
then
echo "Remove $app service"
yunohost service remove $app
fi
2016-10-25 00:00:01 +02:00
2017-10-14 14:38:56 +02:00
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_secure_remove "$final_path"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_remove_nginx_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_remove_logrotate
#=================================================
2017-11-29 15:42:21 +01:00
# SPECIFIC REMOVE
#=================================================
# REMOVE HASTE BINARY
2017-10-14 14:38:56 +02:00
#=================================================
2017-11-29 15:42:21 +01:00
ynh_secure_remove "/usr/bin/$app"
2017-10-14 14:38:56 +02:00
#=================================================
2017-11-29 15:42:21 +01:00
# REMOVE DATADIR DIRECTORY
#=================================================
2017-11-29 17:00:54 +01:00
ynh_secure_remove "/home/yunohost.app/$app"
2017-11-29 15:42:21 +01:00
#=================================================
# REMOVE NODEJS
2017-10-14 14:38:56 +02:00
#=================================================
2017-11-29 15:42:21 +01:00
ynh_remove_nodejs
2017-10-14 14:38:56 +02:00
#=================================================
# GENERIC FINALIZATION
#=================================================
# REMOVE DEDICATED USER
#=================================================
# Delete a system user
ynh_system_user_delete $app