]> git.decadent.org.uk Git - dak.git/blobdiff - config/debian/unchecked.functions
Entirely make cronscript magic
[dak.git] / config / debian / unchecked.functions
diff --git a/config/debian/unchecked.functions b/config/debian/unchecked.functions
new file mode 100644 (file)
index 0000000..87fbda0
--- /dev/null
@@ -0,0 +1,14 @@
+# -*- mode:sh -*-
+
+function precronscript() {
+    # Do not run during dinstall
+    if [[ -e ${LOCK_DAILY} ]]; then
+        exit 0;
+    fi
+    # only run one cron.unchecked and also lock against hourly (newoverview)
+    if ! lockfile -r8 ${LOCK_UNCHECKED} 2> /dev/null; then
+        # log "aborting cron.unchecked because $LOCK_UNCHECKED has already been locked"
+        exit 0
+    fi
+    TMPFILES="${TMPFILES} ${LOCK_UNCHECKED}"
+}
\ No newline at end of file