diff options
author | Stefanie Eckner <stefanie@eckner.net> | 2023-12-31 14:52:20 +0100 |
---|---|---|
committer | Stefanie Eckner <stefanie@eckner.net> | 2023-12-31 14:52:20 +0100 |
commit | 953d24171eeba74e1c1a328e300caad8195d8b46 (patch) | |
tree | 3454f56463dc7dedbbff398f8f636bb2a923f439 | |
parent | bc1d49917f5bc2d5a9d643a42ad34e5c6ffbf735 (diff) | |
download | computer-time-limit-953d24171eeba74e1c1a328e300caad8195d8b46.tar.xz |
bei Netzwerkfehlern trotzdem Zeit weiter zählen
-rwxr-xr-x | computer-time-limit | 6 |
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 |