2019-07-09 18:05:05 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. ./util.sh
|
|
|
|
|
2019-07-11 17:13:31 +02:00
|
|
|
SERVICE_NAME="searx-docker.service"
|
|
|
|
|
2019-07-13 13:28:18 +02:00
|
|
|
if [ ! -x "$(which systemctl)" ]; then
|
2019-07-09 18:05:05 +02:00
|
|
|
echo "systemctl not found" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-07-13 13:28:18 +02:00
|
|
|
if [ ! -x "$(which git)" ]; then
|
2019-07-09 18:05:05 +02:00
|
|
|
echo "git not found" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# stop the systemd service
|
2019-07-13 13:28:18 +02:00
|
|
|
systemctl stop "${SERVICE_NAME}"
|
2019-07-09 18:05:05 +02:00
|
|
|
|
2019-07-11 17:13:31 +02:00
|
|
|
# update, change to 'git pull --rebase --autostash origin master' at your own risk
|
|
|
|
git pull --ff-only --autostash origin master
|
2019-07-09 18:05:05 +02:00
|
|
|
|
2019-07-11 17:13:31 +02:00
|
|
|
if [ $(git ls-files -u | wc -l) -gt 0 ]; then
|
|
|
|
echo "There are git conflicts"
|
|
|
|
else
|
|
|
|
# update docker images
|
|
|
|
docker-compose pull
|
2019-07-09 18:05:05 +02:00
|
|
|
|
2019-07-11 17:13:31 +02:00
|
|
|
# update searx configuration
|
|
|
|
source ./.env
|
|
|
|
docker-compose run searx ${SEARX_COMMAND} -d
|
|
|
|
fi
|
2019-07-09 18:05:05 +02:00
|
|
|
|
|
|
|
# let the user see
|
2019-07-13 13:28:18 +02:00
|
|
|
echo "Use\nsystemctl start \"${SERVICE_NAME}\"\nto restart searx"
|