summaryrefslogtreecommitdiff
path: root/daily
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-05-17 10:41:00 -0400
committerJoey Hess <joeyh@joeyh.name>2016-05-17 10:41:00 -0400
commit63097d804766a1a3cca7b8c4afb245ec7c6479f6 (patch)
treed1842b9d2398f6aea1dc5c777cca28b9279035e7 /daily
parent7c734b05adf5a98be134008dfd7b5cc2c2b5a81d (diff)
AVOID_DAILY_AUTOCOMMITS only disables the cron job
The systemd timer can be disabled by running systemctl, so it's redundant to have another way to disable it. And, users will want to disable the cron job when enabling the timer.
Diffstat (limited to 'daily')
-rwxr-xr-xdaily23
1 files changed, 10 insertions, 13 deletions
diff --git a/daily b/daily
index d35191a..f98c6ad 100755
--- a/daily
+++ b/daily
@@ -2,19 +2,16 @@
# 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
+ # 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