Created
May 24, 2022 19:28
-
-
Save heywoodlh/819d97b9010f7c744c9aa8f19df51445 to your computer and use it in GitHub Desktop.
simple function for inserting otp code into pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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