summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/gauth10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/gauth b/bin/gauth
new file mode 100755
index 0000000..401aff4
--- /dev/null
+++ b/bin/gauth
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Use backup from andOTP
+[ "$1" ] && post="grep -i $1" || post=cat
+# gpg -qd ~/.otp.gpg |
+cat ~/otp_accounts.json |
+jq -r '.[] | "\(.label) \(.secret) \(.issuer)"' |
+while read -r l s i; do
+ printf "%-32s %-10s %s\n" "$l" "$i" "$(oathtool --totp -b "$s")"
+done | $post