[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: netcfg: using udhcpc to get dhcp lease fails


On Mon, Feb 1, 2010 at 1:34 PM, Frans Pop <elendil@planet.nl> wrote:
> On Monday 01 February 2010, Frans Pop wrote:
>> On Monday 01 February 2010, Otavio Salvador wrote:
>> > > I.e, multiple IP addresses should be comma-separated. This also goes
>> > > for ntp-servers, which probably should not have quotes as it's
>> > > similar to dns.
>> >
>> > Fixed both issues; I can't test it now so if you have time do a last
>> > check.
>> This is not going to work in busybox shell:
>>    option domain-name-servers ${dns/ /,};
>> Suggest you use a function, something like:
>> comma_separate() {
>>       echo "$1" | sed "s/ /,/g"
>> }
>> and then use:
>>    option domain-name-servers $(comma_separate "$dns");
>> And the same substitution should be made for ntp servers, which can also
>> have multiple values.
> I've committed this myself (for routers, dns and ntp).

Your suggestion makes the code much nicer to read, indeed, however I
did test it inside of busybox' shell and it worked. Has it failed for

I tried it using busybox sh, in regular system, and it worked.

Your code is OK for me, just to clarify it. I just want to confirm it
has failed.


Otavio Salvador                  O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854         http://projetos.ossystems.com.br

Reply to: