Skip to content

Instantly share code, notes, and snippets.

@heywoodlh
Created May 24, 2022 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heywoodlh/819d97b9010f7c744c9aa8f19df51445 to your computer and use it in GitHub Desktop.
Save heywoodlh/819d97b9010f7c744c9aa8f19df51445 to your computer and use it in GitHub Desktop.
simple function for inserting otp code into pass
pass-insert-otp () {
if [ -z $1 ]
then
echo "Usage: pass-insert-otp example.com/testing"
error="True"
else
error="False"
entry="$1"
fi
if [ "${error}" != "True" ]
then
echo "Enter otp code: "
read otp
otp_uri="otpauth://totp/${entry}?secret=${otp}&issuer=totp-secret"
echo "${otp_uri}" | pass otp insert -e ${entry}
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment