summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2024-09-30 15:28:49 +0200
committerMarc Vertes <mvertes@free.fr>2024-09-30 15:28:49 +0200
commitb8892161449e644c114b956b6002af894f3e5f3f (patch)
tree09765cff65090f69c150fe2ac0dba9e23693474c /bin
parent34f573825b4cb48fa5d80a70d6f3b708b17f25b3 (diff)
update
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