From: Roy Marples Date: Mon, 14 Apr 2008 19:28:28 +0000 (+0000) Subject: Don't compare if file does not exist. X-Git-Tag: v4.0.2~487 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cb85d9bb21273beee6bdfbe1d1ef0467af06ac1;p=thirdparty%2Fdhcpcd.git Don't compare if file does not exist. --- diff --git a/dhcpcd.sh b/dhcpcd.sh index b702daf5..2828a16b 100755 --- a/dhcpcd.sh +++ b/dhcpcd.sh @@ -167,7 +167,9 @@ make_ntp_conf() echo "restrict ${x} nomodify notrap noquery" >> "${cf}" echo "server ${x}" >> "${cf}" done - if type cmp >/dev/null 2>&1; then + if [ ! -e /etc/ntp.conf ]; then + true + elif type cmp >/dev/null 2>&1; then cmp -s /etc/ntp.conf "${cf}" elif type diff >/dev/null 2>&1; then diff -q /etc/ntp.conf "${cf}" >/dev/null