Add otp helpers

This commit is contained in:
Daniel Flanagan 2020-09-17 09:45:58 -05:00
parent 67c8a1d0c4
commit c63739cb19
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
2 changed files with 17 additions and 0 deletions

9
bin/pass-otp Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# TODO: check for pass
key="$1"; shift
args=("$@")
otp="$(pass "$key" | grep -Pi '^otp.*: ?.*$' | cut -d ':' -f 2 | sed 's/ //g')"
simple-otp "$otp"

8
bin/simple-otp Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
# TODO: check for oathtool
key="$1"; shift
args=("$@")
oathtool --totp=sha1 -b "$key" "${args[@]}"