]> git.draconx.ca Git - scripts.git/blobdiff - runcron.sh
Add a script to help deploy nanoc sites.
[scripts.git] / runcron.sh
diff --git a/runcron.sh b/runcron.sh
new file mode 100755 (executable)
index 0000000..f626cd7
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# Copyright © 2011, 2015 Nick Bowler
+#
+# Simple script to dispatch jobs in /etc/cron.whatever.
+#
+# License WTFPL2: Do What The Fuck You Want To Public License, version 2.
+# This is free software: you are free to do what the fuck you want to.
+# There is NO WARRANTY, to the extent permitted by law.
+
+crondir=/etc/cron.$1
+
+if test ! -d "$crondir"; then
+  printf '%s: argument must be one of:' "$0"
+  for i in /etc/cron.*; do
+    if test -d "$i"; then
+      printf ' %s' ${i#/etc/cron.}
+    fi
+  done
+  printf '.\n'
+  exit 1
+fi
+
+run-parts --verbose --regex='^[^.][[:alnum:]_.-]+$' "$crondir"