diff options
Diffstat (limited to 'debian/htdig/htdig-3.2.0b6/debian/htdig.cron.daily')
-rw-r--r-- | debian/htdig/htdig-3.2.0b6/debian/htdig.cron.daily | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/debian/htdig/htdig-3.2.0b6/debian/htdig.cron.daily b/debian/htdig/htdig-3.2.0b6/debian/htdig.cron.daily new file mode 100644 index 00000000..4f50ba79 --- /dev/null +++ b/debian/htdig/htdig-3.2.0b6/debian/htdig.cron.daily @@ -0,0 +1,26 @@ +#!/bin/sh + +if ! `which lockfile-create >/dev/null 2>&1` || [ ! -x /usr/bin/rundig ]; then + exit 0 +fi + +if ! lockfile-create /var/run/htdig.cron; then + # Another htdig indexing cronjob is already running + exit 0 +fi + +lockfile-touch /var/run/htdig.cron & +# Save the PID of the lockfile-touch process +BADGER="$!" + +if [ -r /etc/default/htdig ]; then + if [ -f /usr/bin/rundig ]; then + RUN=$(awk '/^run_rundig/ {print $3}' /etc/default/htdig) + if [ "$RUN" = "true" ]; then + /usr/bin/rundig -a -s + fi + fi +fi + +kill "${BADGER}" >/dev/null 2>&1 +lockfile-remove /var/run/htdig.cron |