瀏覽代碼

Set default search if searx is available

Bob Mottram 7 年之前
父節點
當前提交
1f7c90cd49
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 0
    1
      src/freedombone-app-searx
  2. 4
    0
      src/freedombone-utils-web

+ 0
- 1
src/freedombone-app-searx 查看文件

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 查看文件

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