Changing searx password

This commit is contained in:
Bob Mottram 2017-05-22 14:29:20 +01:00
parent a5f307ddfb
commit 08039edf3b
1 changed files with 9 additions and 1 deletions

View File

@ -200,7 +200,15 @@ function install_interactive_searx {
function change_password_searx {
new_username="$1"
new_user_password="$2"
add_user_searx "$new_username" "$new_user_password"
${PROJECT_NAME}-pass -u $new_username -a searx -p "$new_user_password"
if grep -q "$new_username:" /etc/nginx/.htpasswd; then
sed -i "/$new_username:/d" /etc/nginx/.htpasswd
echo "$new_user_password" | htpasswd -i -s -c /etc/nginx/.htpasswd $new_username
echo '0'
fi
echo '1'
}
function reconfigure_searx {