otp (345B)
1 #!/usr/bin/env bash 2 # Generate OTP passwords (google authenticator alternative) 3 read -sp "Key: " k 4 if command -v pbcopy &> /dev/null; then 5 oathtool --totp --base32 "$k" | pbcopy 6 echo "copied." 7 elif command -v xclip &> /dev/null; then 8 oathtool --totp --base32 "$k" | xclip -sel clip 9 echo "copied." 10 else 11 oathtool --totp --base32 "$k" 12 fi