]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
ntp.conf could have more than just servers, but DHCP only knows about servers. Soluti...
authorRoy Marples <roy@marples.name>
Tue, 12 Aug 2008 20:46:42 +0000 (20:46 +0000)
committerRoy Marples <roy@marples.name>
Tue, 12 Aug 2008 20:46:42 +0000 (20:46 +0000)
dhcpcd-hooks/50-ntp.conf

index 2b3e40e4a7c08fe9db1ca1b8d1df9b29b6229c8e..6cc1b67090d41501294b1b392666d8081ba02cfb 100644 (file)
@@ -14,11 +14,10 @@ make_ntp_conf()
 {
        [ -z "${new_ntp_servers}" ] && return 0
        local cf=/etc/ntp.conf."${interface}" x=
-       echo "# ${signature}" > "${cf}"
-       echo "restrict default noquery notrust nomodify" >> "${cf}"
-       echo "restrict 127.0.0.1" >> "${cf}"
+
+       grep -v "\(^[ \t]*server[ \t]*\|${signature}\)" /etc/ntp.conf > "${cf}"
+       echo "# ${signature}" >> "${cf}"
        for x in ${new_ntp_servers}; do
-               echo "restrict ${x} nomodify notrap noquery" >> "${cf}"
                echo "server ${x}" >> "${cf}"
        done
        save_conf /etc/ntp.conf