summaryrefslogtreecommitdiff
path: root/debian/cron.daily
blob: ae417950ad214899a9da448f84a28fbf03af6b46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
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 "$pe" ] && [ -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