Add otp support to bin/pass-get

This commit is contained in:
Henrik Lissner 2018-01-23 22:51:22 -05:00
parent 566a187f3d
commit ed8980474e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -17,11 +17,11 @@ if [[ ! $secrets ]]; then
exit 2 exit 2
fi fi
if [[ $field == password || -z $field ]]; then case $field in
printf "%s" "$(head -n1 <<<"$secrets")" password) printf "%s" "$(head -n1 <<<"$secrets")" ;;
else otp) printf "%s" "$(pass otp "$entry")" ;;
printf "%s" "$(awk -v "key=$field:" '$1 == key {print $2}' <<<"$secrets")" *) printf "%s" "$(awk -v "key=$field:" '$1 == key {print $2}' <<<"$secrets")" ;;
fi | xsel -i -b -t 15000 esac | xsel -i -b -t 15000
# #
echo "Copied $entry:$field to clipboard for 15s" echo "Copied $entry:$field to clipboard for 15s"