allow entries to share passwords by referencing a password file with "#FILE=SOME_FILE" where SOME_FILE is relative to your PASSWORD_STORE_ROOT.

This commit is contained in:
Rasmus Steinke 2016-12-12 18:23:13 +01:00
parent ee1e651f4f
commit 752cfb7067

View File

@ -256,6 +256,11 @@ Run ${default_do} with <span color='$help_color'>Enter</span>. For more help hit
# pass_key_value=$(echo "${fields}" | awk '$1 ~ /:$/{$1=$1;print}') # pass_key_value=$(echo "${fields}" | awk '$1 ~ /:$/{$1=$1;print}')
mapfile -t password_temp < <(PASSWORD_STORE_DIR="${root}" pass "$selected_password") mapfile -t password_temp < <(PASSWORD_STORE_DIR="${root}" pass "$selected_password")
password=${password_temp[0]} password=${password_temp[0]}
if [[ ${password} == "#FILE="* ]]; then
pass_file="${password#*=}"
mapfile -t password_temp < <(PASSWORD_STORE_DIR="${root}" pass "${pass_file}")
password=${password_temp[0]}
fi
fields=$(printf '%s\n' "${password_temp[@]:1}" | awk '$1 ~ /:$/{$1=$1;print}') fields=$(printf '%s\n' "${password_temp[@]:1}" | awk '$1 ~ /:$/{$1=$1;print}')
declare -A stuff declare -A stuff