On Wed, Mar 19, 2014 at 03:37:25AM +0000, Laszlo Papp wrote: > On Tue, Mar 18, 2014 at 10:46 PM, Xabier Oneca -- xOneca > <[email protected]> wrote: > > Hello Laszlo, > > > > 2014-03-18 22:28 GMT+01:00 Laszlo Papp <[email protected]>: > >>> If you want a configuration file > >>> only for the time servers, this script will give you compatibility to the > >>> ntp.org config file: > >>> #!/bin/sh > >>> NTPD_OPTIONS="..." > >>> exec busybox ntpd $NTPD_OPTIONS $(sed -nre 's/^server *(.*)$/-p > >>> \1/g'/etc/ntp.conf ) > >> > >> I wonder if you are serious about this compared to the alternative way: > >> > >> /etc/busybox-ntpd/busybox-ntpd.conf > >> foo=bar > > > > I think you didn't see what Ralf did there. He is actually parsing an > > (standard?) ntp.conf file and picking the 'server xxxx' lines to pass > > as -p xxxx options to BB ntpd. > > > > There. You don't have to "invent" another config file for ntpd. He > > parsed the "original" format for Busybox to understand it! > > And I explained several times why that is wrong. As written several > times already now, in a few minutes 4 different ways were revealed in > the beginning of the threads, and I am sure not even everyone spoke > up.
I don't see any clear explanation of why that's wrong. I'll agree that sed is a poor hack of a 'parser', but it's easy to do this correctly with shell script (often the 'read' and 'case' commands are sufficient for parsing without even invoking external tools). At the very least please try to have a rational discussion here and understand why most busybox users and developers are opposed to the sort of feature creep you're asking for. Rich _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
