summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefanie Eckner <stefanie@eckner.net>2023-12-31 14:52:20 +0100
committerStefanie Eckner <stefanie@eckner.net>2023-12-31 14:52:20 +0100
commit953d24171eeba74e1c1a328e300caad8195d8b46 (patch)
tree3454f56463dc7dedbbff398f8f636bb2a923f439
parentbc1d49917f5bc2d5a9d643a42ad34e5c6ffbf735 (diff)
downloadcomputer-time-limit-953d24171eeba74e1c1a328e300caad8195d8b46.tar.xz
bei Netzwerkfehlern trotzdem Zeit weiter zählen
-rwxr-xr-xcomputer-time-limit6
1 files changed, 6 insertions, 0 deletions
diff --git a/computer-time-limit b/computer-time-limit
index a872d01..93feb43 100755
--- a/computer-time-limit
+++ b/computer-time-limit
@@ -49,9 +49,14 @@ wie_lange_noch() {
)
if [ -n "${erg}" ] && ! echo "${erg}" | grep -qvx '[0-9]\+'; then
noch="${erg}"
+ ab=$(date +%s)
+ else
+ noch=$((ab+noch-$(date +%s)))
+ ab=$(date +%s)
fi
else
noch=0
+ ab=$(date +%s)
fi
}
@@ -102,6 +107,7 @@ check_time() {
trap 'sende_msg stop' EXIT
noch=0
+ab=$(date +%s)
while still_logged_in; do
sleep 1