浏览代码

Changing searx password

Bob Mottram 8 年前
父节点
当前提交
08039edf3b
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9
    1
      src/freedombone-app-searx

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

200
 function change_password_searx {
200
 function change_password_searx {
201
     new_username="$1"
201
     new_username="$1"
202
     new_user_password="$2"
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
 function reconfigure_searx {
214
 function reconfigure_searx {