From 1f7c90cd49c3082eeb72fa1e90818d69d734bc16 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 23 Sep 2017 12:28:57 +0100 Subject: [PATCH] Set default search if searx is available --- src/freedombone-app-searx | 1 - src/freedombone-utils-web | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/freedombone-app-searx b/src/freedombone-app-searx index 6499d582..070aaa2d 100755 --- a/src/freedombone-app-searx +++ b/src/freedombone-app-searx @@ -1011,7 +1011,6 @@ function install_searx { systemctl daemon-reload systemctl start searx.service - DEFAULT_SEARCH="http://$SEARX_ONION_HOSTNAME" update_default_search_engine SEARX_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})" diff --git a/src/freedombone-utils-web b/src/freedombone-utils-web index a63dda38..2376ee9d 100755 --- a/src/freedombone-utils-web +++ b/src/freedombone-utils-web @@ -535,6 +535,10 @@ function install_dynamicdns { } function update_default_search_engine { + if [ -f /var/lib/tor/hidden_service_searx/hostname ]; then + DEFAULT_SEARCH="http://$(cat /var/lib/tor/hidden_service_searx/hostname)" + fi + for d in /home/*/ ; do USERNAME=$(echo "$d" | awk -F '/' '{print $3}') if [[ $(is_valid_user "$USERNAME") == "1" ]]; then