summaryrefslogtreecommitdiff
path: root/bin/gauth
blob: 401aff4e1def361c349330f0c753e0f2b7487f9e (plain)
1
2
3
4
5
6
7
8
9
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