From 5c6ee645a4c9d5064750bafd3aed3a5be9270d49 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 23 Mar 2024 20:58:02 +0100 Subject: computer-time-limit: update before locking --- computer-time-limit | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/computer-time-limit b/computer-time-limit index 8ca0515..e072d62 100755 --- a/computer-time-limit +++ b/computer-time-limit @@ -5,11 +5,6 @@ url='https://eckner.net/computer-time-limit.php' lock_file=~/.computer-time-limit.lock -exec 9> "${lock_file}" -if ! flock -n 9; then - exit -fi - if [ -d "${dir}"'/.git' ] && [ $# -eq 0 ] && [ "$(stat -c%U "${dir}"'/.git')" = "$(whoami)" ]; then git -C "${dir}" fetch --all -p 2>/dev/null if [ -z "$(git -C "${dir}" status --porcelain)" ]; then @@ -18,6 +13,11 @@ if [ -d "${dir}"'/.git' ] && [ $# -eq 0 ] && [ "$(stat -c%U "${dir}"'/.git')" = fi fi +exec 9> "${lock_file}" +if ! flock -n 9; then + exit +fi + . /etc/computer-time-limit.conf sende_msg() { -- cgit v1.2.3-70-g09d2