kanako/addons/kanako_totp
koizumi.aoi 8729322382 Moved addons to their own directory. Add kanako_gen, Removed
kanako-init, etc.

Signed-off-by: Aoi K <koizumi.aoi@kyoko-project.wer.ee>

git-svn-id: file:///srv/svn/repo/kanako/trunk@11 62e5d677-aa6e-8c4a-b8cb-b9416171cb8e
2022-10-18 21:57:56 +00:00

13 lines
308 B
Bash
Executable File

#!/bin/sh -e
# 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