]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Ensure that ntp.conf exists before removing markers.
authorRoy Marples <roy@marples.name>
Wed, 8 Jul 2009 17:05:29 +0000 (17:05 +0000)
committerRoy Marples <roy@marples.name>
Wed, 8 Jul 2009 17:05:29 +0000 (17:05 +0000)
dhcpcd-hooks/50-ntp.conf

index b88553f0fe34851cbd0fb075fc37bf4dd26eb7b8..8fad6df55b334ded07539380d1d4f20940cbd354 100644 (file)
@@ -48,8 +48,10 @@ build_ntp_conf()
        # Merge our config into ntp.conf
        [ -e "$cf" ] && rm -f "$cf"
        [ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"
-       remove_markers "$signature_base" "$signature_base_end" \
-               "$ntp_conf" > "$cf"
+       if [ -e "$ntp_conf" ]; then
+               remove_markers "$signature_base" "$signature_base_end" \
+                       "$ntp_conf" > "$cf"
+       fi
        if [ -n "$servers" ]; then
                echo "$signature_base${header:+ $from }$header" >> "$cf"
                printf "$search$servers" >> "$cf"