Browse Source

Set default search if searx is available

Bob Mottram 7 years ago
parent
commit
1f7c90cd49
2 changed files with 4 additions and 1 deletions
  1. 0
    1
      src/freedombone-app-searx
  2. 4
    0
      src/freedombone-utils-web

+ 0
- 1
src/freedombone-app-searx View File

1011
     systemctl daemon-reload
1011
     systemctl daemon-reload
1012
     systemctl start searx.service
1012
     systemctl start searx.service
1013
 
1013
 
1014
-    DEFAULT_SEARCH="http://$SEARX_ONION_HOSTNAME"
1015
     update_default_search_engine
1014
     update_default_search_engine
1016
 
1015
 
1017
     SEARX_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
1016
     SEARX_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"

+ 4
- 0
src/freedombone-utils-web View File

535
 }
535
 }
536
 
536
 
537
 function update_default_search_engine {
537
 function update_default_search_engine {
538
+    if [ -f /var/lib/tor/hidden_service_searx/hostname ]; then
539
+        DEFAULT_SEARCH="http://$(cat /var/lib/tor/hidden_service_searx/hostname)"
540
+    fi
541
+
538
     for d in /home/*/ ; do
542
     for d in /home/*/ ; do
539
         USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
543
         USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
540
         if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
544
         if [[ $(is_valid_user "$USERNAME") == "1" ]]; then