diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-02-13 13:32:59 -0500 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-02-13 13:32:59 -0500 |
commit | 7c6524d6a78e0efe6839a5ff0f998013a5476dce (patch) | |
tree | ce6feb15c0ad0b812289a3679859f4f768c29360 /debian | |
parent | a97d887845955b58ab14bfb6e65f4e6868408872 (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
Diffstat (limited to 'debian')
-rw-r--r-- | debian/cron.daily | 10 |
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 |