From 3878f0d51ab7dff3af4f89b7c5ad82a5fd7e0406 Mon Sep 17 00:00:00 2001 From: Dalf Date: Sat, 13 Jul 2019 13:28:18 +0200 Subject: [PATCH] Minor bug fixed, minor changes --- .env | 4 +++- .gitignore | 5 +++++ start.sh | 14 -------------- update.sh | 8 ++++---- util.sh | 5 +++++ 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.env b/.env index 666f8e7..77cfc40 100644 --- a/.env +++ b/.env @@ -1,5 +1,7 @@ -# hostname and protocol (empty except for localhost, set to "https://") +# hostname SEARX_HOSTNAME=localhost + +# comment both if SEARX_HOSTNAME is NOT localhost SEARX_PROTOCOL=https:// SEARX_TLS=self_signed diff --git a/.gitignore b/.gitignore index b25c15b..7210ad4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ *~ + +searx-docker.service +caddy +srv +searx diff --git a/start.sh b/start.sh index 73f1170..ec974c3 100755 --- a/start.sh +++ b/start.sh @@ -5,20 +5,6 @@ cd -- "$BASE_DIR" . ./util.sh -if grep -q "MORTY_KEY=RemplaceWithARealKey!" .env; then - echo "In the .env file, you must configure MORTY_KEY" 1>&2 - CANT_START=1 -fi - -if grep -q "FILTRON_PASSWORD=password" .env; then - echo "In the .env file, you must configure FILTRON_PASSWORD" 1>&2 - CANT_START=1 -fi - -if [ $CANT_START ]; then - exit 1 -fi - $DOCKERCOMPOSE -f $DOCKERCOMPOSEFILE down -v $DOCKERCOMPOSE -f $DOCKERCOMPOSEFILE rm -fv $DOCKERCOMPOSE -f $DOCKERCOMPOSEFILE up diff --git a/update.sh b/update.sh index 4d70ba9..d81c336 100755 --- a/update.sh +++ b/update.sh @@ -4,18 +4,18 @@ SERVICE_NAME="searx-docker.service" -if [ ! -x "${which systemctl}" ]; then +if [ ! -x "$(which systemctl)" ]; then echo "systemctl not found" 1>&2 exit 1 fi -if [ ! -x "${which git}" ]; then +if [ ! -x "$(which git)" ]; then echo "git not found" 1>&2 exit 1 fi # stop the systemd service -systemctl stop searx-docker.service +systemctl stop "${SERVICE_NAME}" # update, change to 'git pull --rebase --autostash origin master' at your own risk git pull --ff-only --autostash origin master @@ -32,4 +32,4 @@ else fi # let the user see -echo "Use\nsystemctl start searx-docker.service\nto restart searx" +echo "Use\nsystemctl start \"${SERVICE_NAME}\"\nto restart searx" diff --git a/util.sh b/util.sh index 9cfd4d0..a5b5727 100644 --- a/util.sh +++ b/util.sh @@ -24,3 +24,8 @@ if [ ! -f "${DOCKERCOMPOSEFILE}" ]; then echo "${DOCKERCOMPOSEFILE} not found" 1>&2 exit 1 fi + +if [ -x $(git diff --name-only | grep .env) ]; then + echo "The .env must be changed" 1>&2 + exit 1 +fi