I’m working on Issue #4588 (ntpd needs UCI parsing comparable to sysntpd) and I 
had a question…

ntpd ships with the canned /etc/ntp.conf from the distro, but if we specify:


config timeserver ntp
        list server ‘ntp.redfish-solutions.com’


then the /etc/ntp.conf file needs to be rewritten as:


driftfile /var/lib/ntp/ntp.drift

server 0.openwrt.pool.ntp.org iburst
server 1.openwrt.pool.ntp.org iburst
server 2.openwrt.pool.ntp.org iburst
server 3.openwrt.pool.ntp.org iburst
...


to:


drift file /var/lib/ntp/ntp.drift

server ntp.redfish-solutions.com iburst
...


instead.  Are there any good guidelines (or examples) on how to mangle config 
files in-place?

I’m guessing I’d need a sed script with a loop to gather all of the ‘server’ 
lines and replace them with one.

Or am I missing something obvious?

Thanks,

-Philip


_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to