kanako/addons/kanako-totp
yakumo.izuru 3df57c1b07 Release v2
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: https://svn.yakumo.dev/yakumo.izuru/kanako/trunk@20 62e5d677-aa6e-8c4a-b8cb-b9416171cb8e
2023-09-11 16:59:07 +00:00

14 lines
378 B
Bash

#!/bin/sh -e
# $TheSupernovaDuo: kanako,v 1.9 2023/5/18 21:9:33 yakumo_izuru Exp $
# extracted from https://rgz.ee/bin/pass
totp_seed="$(kanako -v "$@" | grep 'totp: ' | head -n1 | cut -d' ' -f2)"
if ! [ -z "$totp_seed" ]; then
if command -v oathtool >/dev/null 2>&1; then
oathtool --totp -b "$totp_seed"
else
echo 'oathtool(1) should be installed'
exit 1
fi
fi