try to fix password-only entries

This commit is contained in:
Rasmus Steinke 2016-08-17 19:10:39 +02:00
parent ec6efa602d
commit b0406cd1ba

View File

@ -257,12 +257,13 @@ Run ${default_do} with <span color='$help_color'>Enter</span>. For more help hit
password="${password_temp%%$'\n'*}" password="${password_temp%%$'\n'*}"
pass_key_value=$(echo "${password_temp}" | awk '$1 ~ /:$/{$1=$1;print}') pass_key_value=$(echo "${password_temp}" | awk '$1 ~ /:$/{$1=$1;print}')
declare -A stuff declare -A stuff
stuff["pass"]=${password}
if [[ -n $pass_key_value ]]; then
while read -r LINE; do while read -r LINE; do
_id="${LINE%%: *}" _id="${LINE%%: *}"
_val="${LINE#* }" _val="${LINE#* }"
stuff["${_id}"]=${_val} stuff["${_id}"]=${_val}
done < <(echo "${pass_key_value}") done < <(echo "${pass_key_value}")
stuff["pass"]=${password}
if test "${stuff['autotype']+autotype}" if test "${stuff['autotype']+autotype}"
then then
: :
@ -270,6 +271,7 @@ Run ${default_do} with <span color='$help_color'>Enter</span>. For more help hit
stuff["autotype"]="${USERNAME_field} :tab pass" stuff["autotype"]="${USERNAME_field} :tab pass"
fi fi
fi fi
fi
pass_content="$(for key in "${!stuff[@]}"; do echo "${key}: ${stuff[$key]}"; done)" pass_content="$(for key in "${!stuff[@]}"; do echo "${key}: ${stuff[$key]}"; done)"
# actions based on keypresses # actions based on keypresses