瀏覽代碼

Changing searx password

Bob Mottram 7 年之前
父節點
當前提交
08039edf3b
共有 1 個檔案被更改,包括 9 行新增1 行删除
  1. 9
    1
      src/freedombone-app-searx

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

@@ -200,7 +200,15 @@ function install_interactive_searx {
200 200
 function change_password_searx {
201 201
     new_username="$1"
202 202
     new_user_password="$2"
203
-    add_user_searx "$new_username" "$new_user_password"
203
+
204
+    ${PROJECT_NAME}-pass -u $new_username -a searx -p "$new_user_password"
205
+
206
+    if grep -q "$new_username:" /etc/nginx/.htpasswd; then
207
+        sed -i "/$new_username:/d" /etc/nginx/.htpasswd
208
+        echo "$new_user_password" | htpasswd -i -s -c /etc/nginx/.htpasswd $new_username
209
+        echo '0'
210
+    fi
211
+    echo '1'
204 212
 }
205 213
 
206 214
 function reconfigure_searx {