Add otp support to bin/pass-get
This commit is contained in:
parent
566a187f3d
commit
ed8980474e
10
bin/pass-get
10
bin/pass-get
|
@ -17,11 +17,11 @@ if [[ ! $secrets ]]; then
|
|||
exit 2
|
||||
fi
|
||||
|
||||
if [[ $field == password || -z $field ]]; then
|
||||
printf "%s" "$(head -n1 <<<"$secrets")"
|
||||
else
|
||||
printf "%s" "$(awk -v "key=$field:" '$1 == key {print $2}' <<<"$secrets")"
|
||||
fi | xsel -i -b -t 15000
|
||||
case $field in
|
||||
password) printf "%s" "$(head -n1 <<<"$secrets")" ;;
|
||||
otp) printf "%s" "$(pass otp "$entry")" ;;
|
||||
*) printf "%s" "$(awk -v "key=$field:" '$1 == key {print $2}' <<<"$secrets")" ;;
|
||||
esac | xsel -i -b -t 15000
|
||||
|
||||
#
|
||||
echo "Copied $entry:$field to clipboard for 15s"
|
||||
|
|
Loading…
Reference in a new issue