summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2024-03-23 20:58:02 +0100
committerErich Eckner <git@eckner.net>2024-03-23 20:58:02 +0100
commit5c6ee645a4c9d5064750bafd3aed3a5be9270d49 (patch)
treec7b3a858ccfc158ea7d7098b7501056c65e19091
parentaff8b34f803054fcad66eff941a67d26d3950b9f (diff)
downloadcomputer-time-limit-5c6ee645a4c9d5064750bafd3aed3a5be9270d49.tar.xz
computer-time-limit: update before locking
-rwxr-xr-xcomputer-time-limit10
1 files 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() {