From 7c6524d6a78e0efe6839a5ff0f998013a5476dce Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 13 Feb 2009 13:32:59 -0500 Subject: 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 --- debian/cron.daily | 10 ++++++---- 1 file 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 -- cgit v1.2.3