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

91 lines
2.6 KiB
Text
Raw Normal View History

2014-05-10 11:54:15 +02:00
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2014-05-10 11:54:15 +02:00
2019-03-03 20:32:26 +01:00
source _common.sh
source /usr/share/yunohost/helpers
2016-07-04 21:16:34 +02:00
#=================================================
# LOAD SETTINGS
#=================================================
2019-03-03 20:33:02 +01:00
ynh_print_info "Loading installation settings..."
2016-07-04 21:16:34 +02:00
app=$YNH_APP_INSTANCE_NAME
2016-07-04 21:16:34 +02:00
domain=$(ynh_app_setting_get $app domain)
2019-03-03 20:32:26 +01:00
final_path=$(ynh_app_setting_get $app final_path)
#=================================================
# STANDARD REMOVE
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
2019-03-03 20:33:02 +01:00
ynh_print_info "Stopping and removing the systemd service"
2017-08-28 03:03:36 +02:00
# Remove the uwsgi configuration
2019-03-03 20:32:26 +01:00
ynh_systemd_action --service_name=uwsgi --action=stop
if [ -h "/etc/uwsgi/apps-enabled/$app.ini" ]
then
ynh_print_info "Delete uwsgi config for $app"
ynh_secure_remove "/etc/uwsgi/apps-enabled/$app.ini"
fi
ynh_secure_remove "/etc/uwsgi/apps-available/$app.ini"
#=================================================
# REMOVE DEPENDENCIES
#=================================================
2019-03-03 20:33:02 +01:00
ynh_print_info "Removing dependencies"
ynh_remove_app_dependencies
#=================================================
# REMOVE THE MAIN DIR OF THE APP
#=================================================
2019-03-03 20:33:02 +01:00
ynh_print_info "Removing app main directory"
2019-03-03 20:32:26 +01:00
ynh_secure_remove "$final_path"
#=================================================
# REMOVE THE NGINX CONFIGURATION
#=================================================
2019-03-03 20:33:02 +01:00
ynh_print_info "Removing nginx web server configuration"
2017-08-28 03:03:36 +02:00
# Remove the dedicated nginx config
ynh_remove_nginx_config
#=================================================
2019-03-03 20:32:26 +01:00
# REMOVE SERVICE FROM ADMIN PANEL
#=================================================
if [ -e /etc/init.d/uwsgi ]
then
# Redémarre le service uwsgi si il n'est pas désinstallé.
2019-03-03 20:32:26 +01:00
ynh_systemd_action --service_name=uwsgi --action=start
else
2019-03-03 20:32:26 +01:00
if yunohost service status | grep -q uwsgi
then
2019-03-03 20:32:26 +01:00
ynh_print_info "Remove uwsgi service"
2017-08-28 03:03:36 +02:00
yunohost service remove uwsgi
fi
2016-07-05 12:25:33 +02:00
fi
#=================================================
2019-03-03 20:32:26 +01:00
# GENERIC FINALIZATION
#=================================================
# REMOVE DEDICATED USER
#=================================================
2019-03-03 20:33:02 +01:00
ynh_print_info "Removing the dedicated system user"
2017-08-28 03:03:36 +02:00
# Delete a system user
ynh_system_user_delete $app
2019-03-03 20:33:02 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info "Removal of $app completed"