Last active
April 15, 2021 02:17
-
-
Save WallaceTan/859d17b5f5631ca411c1c4d283ea07c4 to your computer and use it in GitHub Desktop.
Command line OTP generator and copy generated OTP to MacOS clipboard
This file contains 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
# File Path: ~/bin/otp-{APP}-{USERNAME}.sh | |
#!/bin/bash | |
# Generate OTP with oathtool and SECRET-KEY from QR-code. | |
# Pipe to tee | |
# Strip the ending NEW-LINE ('\n') | |
# Pipe to MacOS clipboard | |
echo -e "$(/usr/local/bin/oathtool --totp -b [SECRET-KEY])" | tee >(tr -d '\n' | pbcopy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment