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
|