diff options
-rwxr-xr-x | computer-time-limit | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/computer-time-limit b/computer-time-limit index 80fc98c..a3a05cb 100755 --- a/computer-time-limit +++ b/computer-time-limit @@ -35,20 +35,20 @@ sende_msg() { } wie_lange_noch() { - if [ -f "$1" ]; then - erg=$( - sende_msg start "$1" - ) - 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 + if [ ! -f "$1" ]; then noch=0 ab=$(date +%s) + return + fi + erg=$( + sende_msg start "$1" + ) + 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 } |