summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2024-11-06 17:37:15 +0100
committerErich Eckner <git@eckner.net>2024-11-06 17:37:15 +0100
commitf83c6961e352f8147db74c6b1da680f2ea1234da (patch)
tree46eaed6a5a3d73a207bc272728e37cade60b602c
parent772647865e0fec1670fa28e4987790e439840ff2 (diff)
downloadcomputer-time-limit-f83c6961e352f8147db74c6b1da680f2ea1234da.tar.xz
computer-time-limit: try 30 seconds to check the yubikey
* looks, like sometimes the validation may fail
-rwxr-xr-xcomputer-time-limit22
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=$(