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
|
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"
|
||||||
|
|
Loading…
Reference in a new issue