Failure message for short passwords

This commit is contained in:
Bob Mottram 2017-05-22 14:35:40 +01:00
parent 08039edf3b
commit 50fb913747
2 changed files with 4 additions and 2 deletions

View File

@ -201,11 +201,10 @@ function change_password_searx {
new_username="$1"
new_user_password="$2"
${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
${PROJECT_NAME}-pass -u $curr_username -a searx -p "$new_user_password"
echo '0'
fi
echo '1'

View File

@ -229,6 +229,9 @@ function view_or_change_passwords {
change_password_${SELECTED_APP} ${SELECTED_USERNAME} "${CURR_PASSWORD}"
dialog --title $"Change password" \
--msgbox $"The password was changed" 6 40
else
dialog --title $"Change password" \
--msgbox $"The password given must be at least 8 characters" 6 40
fi
;;
esac