summaryrefslogtreecommitdiff
path: root/daily
diff options
context:
space:
mode:
Diffstat (limited to 'daily')
-rwxr-xr-xdaily20
1 files changed, 20 insertions, 0 deletions
diff --git a/daily b/daily
new file mode 100755
index 0000000..d35191a
--- /dev/null
+++ b/daily
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Script that can be run daily to autocommit /etc changes.
+set -e
+if [ -x /usr/bin/etckeeper ] && [ -e /etc/etckeeper/etckeeper.conf ]; then
+ . /etc/etckeeper/etckeeper.conf
+ if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then
+ # avoid autocommit if an install run is in progress
+ lockfile=/var/cache/etckeeper/packagelist.pre-install
+ if [ -e "$lockfile" ] && [ -n "$(find "$lockfile" -mtime +1)" ]; then
+ rm -f "$lockfile" # stale
+ fi
+ if [ ! -e "$lockfile" ]; then
+ AVOID_SPECIAL_FILE_WARNING=1
+ export AVOID_SPECIAL_FILE_WARNING
+ if etckeeper unclean; then
+ etckeeper commit "daily autocommit" >/dev/null
+ fi
+ fi
+ fi
+fi