summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-02-13 13:32:59 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-02-13 13:32:59 -0500
commit7c6524d6a78e0efe6839a5ff0f998013a5476dce (patch)
treece6feb15c0ad0b812289a3679859f4f768c29360
parenta97d887845955b58ab14bfb6e65f4e6868408872 (diff)
test for files, avoid hardcoding path unnecessarily
Make sure the files exist, so that if etckeeper is removed, the cron job will stop. etckeeper should be in the path
-rw-r--r--debian/cron.daily10
1 files changed, 6 insertions, 4 deletions
diff --git a/debian/cron.daily b/debian/cron.daily
index ce6cb31..6b7ccf7 100644
--- a/debian/cron.daily
+++ b/debian/cron.daily
@@ -1,8 +1,10 @@
#!/bin/sh
set -e
-. /etc/etckeeper/etckeeper.conf
-if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then
- if /usr/sbin/etckeeper unclean; then
- /usr/sbin/etckeeper commit "Daily autocommit"
+if [ -x /usr/sbin/etckeeper ] && [ -e /etc/etckeeper/etckeeper.conf ]; then
+ . /etc/etckeeper/etckeeper.conf
+ if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then
+ if etckeeper unclean; then
+ etckeeper commit "daily autocommit"
+ fi
fi
fi