2014-05-10 11:54:15 +02:00
|
|
|
#!/bin/bash
|
2016-07-04 21:16:34 +02:00
|
|
|
app="searx"
|
2014-05-10 11:54:15 +02:00
|
|
|
|
2016-07-04 21:16:34 +02:00
|
|
|
# Source app helpers
|
|
|
|
. /usr/share/yunohost/helpers
|
2014-05-10 11:54:15 +02:00
|
|
|
|
2016-07-04 21:16:34 +02:00
|
|
|
# Retrieve arguments
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
|
|
|
|
# Remove files
|
|
|
|
sudo rm -Rf /opt/yunohost/$app
|
|
|
|
sudo rm -f /etc/uwsgi/apps-enabled/$app.ini
|
|
|
|
sudo rm -f /etc/uwsgi/apps-available/$app.ini
|
|
|
|
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
|
|
|
|
2016-07-05 12:49:44 +02:00
|
|
|
# Stop uwsgi
|
2014-05-10 11:54:15 +02:00
|
|
|
sudo service uwsgi stop
|
|
|
|
sudo killall uwsgi
|
2016-07-04 21:16:34 +02:00
|
|
|
|
2016-07-07 10:38:24 +02:00
|
|
|
# Remove user (kill attached process before)
|
2016-07-05 12:25:33 +02:00
|
|
|
if id -u searx > /dev/null 2>&1; then
|
2016-07-07 10:38:24 +02:00
|
|
|
sudo killall -KILL -u searx
|
|
|
|
sudo userdel --force searx
|
2016-07-05 12:25:33 +02:00
|
|
|
fi
|
2016-07-05 12:49:44 +02:00
|
|
|
|
|
|
|
# Restart uwsgi
|
|
|
|
sudo service uwsgi start
|
|
|
|
|
2016-07-04 21:16:34 +02:00
|
|
|
# Reload Nginx
|
|
|
|
sudo service nginx reload
|