Skip to content

Instantly share code, notes, and snippets.

@stfnhh
Created July 20, 2022 20:12
Show Gist options
  • Save stfnhh/c2bcc88faf56264f556ffec084989f66 to your computer and use it in GitHub Desktop.
Save stfnhh/c2bcc88faf56264f556ffec084989f66 to your computer and use it in GitHub Desktop.
otp
#!/usr/bin/env bash
if [ -z $1 ]; then
echo
echo "Usage:"
echo " otp google"
echo
echo "Configuration: $HOME/.otpkeys"
echo "Format: name=key"
exit
fi
OTPKEY=$(sed -n "s/${1}=//p" $HOME/.otpkeys)
if [ -z $OTPKEY ]; then
echo "$(basename $0): Bad Service Name '$1'"
$0
exit
fi
/usr/local/bin/oathtool --totp -b $OTPKEY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment