Commit ac70c882f148
Changed files (1)
pkgs
my
scripts
bin
pkgs/my/scripts/bin/authkey
@@ -6,5 +6,10 @@ if [ -f ~/.oath/key ]; then
oathtool --hotp "$(cat ~/.oath/key)" -c "$([ ! -f ~/.oath/counter ] && echo -n 0 > ~/.oath/counter || echo -n $(($(cat ~/.oath/counter)+1)) > ~/.oath/counter; cat ~/.oath/counter)"
else
# Fallback: YubiKey OATH
+ if ! ykman info &>/dev/null; then
+ notify-send --urgency=critical "authkey" "YubiKey not connected. Please plug in your YubiKey."
+ echo "Error: YubiKey not connected" >&2
+ exit 1
+ fi
ykman oath accounts code --single "Red Hat:redhat" 2>/dev/null | grep -oE '[0-9]{6,8}'
fi
\ No newline at end of file