From f83c6961e352f8147db74c6b1da680f2ea1234da Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 6 Nov 2024 17:37:15 +0100 Subject: computer-time-limit: try 30 seconds to check the yubikey * looks, like sometimes the validation may fail --- computer-time-limit | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/computer-time-limit b/computer-time-limit index c93164a..0075498 100755 --- a/computer-time-limit +++ b/computer-time-limit @@ -43,14 +43,20 @@ wie_lange_noch() { home=$(getent passwd "${user}" | cut -d: -f6) if [ -d "${home}" ]; then cd "${home}" - if [ -f '.shared_secret' ] \ - && [ -f '/usr/src/skripte/ykverify/verify.py' ] \ - && ! '/usr/src/skripte/ykverify/verify.py'; then - noch=0 - ab=$(date +%s) - cd - - return - fi + for i in {30..0}; do + if [ ! -f '.shared_secret' ] \ + || [ ! -f '/usr/src/skripte/ykverify/verify.py' ] \ + || '/usr/src/skripte/ykverify/verify.py'; then + break + fi + if [ "${i}" -eq 0 ]; then + noch=0 + ab=$(date +%s) + cd - >/dev/null + return + fi + sleep 1 + done cd - >/dev/null fi erg=$( -- cgit v1.2.3-70-g09d2