Re: netcfg: using udhcpc to get dhcp lease fails
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/ /,};
# test="a b c"
# echo ${test/ /,}
/bin/sh: syntax error: bad substitution
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.
Reply to: