diff options
-rwxr-xr-x | computer-time-limit | 22 |
1 files 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=$( |