Hi Bastian:

> Date: Sat, 18 Oct 2014 22:37:59 +0200
> From: bitt...@bluebottle.com
> To: nlhi...@hotmail.com
> CC: nolt...@gmail.com; openwrt-devel@lists.openwrt.org; ha...@hauke-m.de
> Subject: Re: [OpenWrt-Devel] [PATCH v4] brcm-wl: fix bash comparison error
> 
> * Nathan Hintz <nlhi...@hotmail.com> [18.10.2014 22:24]:
> > Using the "\n" is not correct.  I think the real problem is that the logic 
> > is reversed (should be && instead of ||); although it might
> > be better to eliminate the conditional entirely since leddc is always 
> > commanded to "0xffff" when the interface is taken down.
> > 
> > local leddc=$(wlc ifname "$device" leddc)
> > [ "$leddc" = "0xffff" ] && {
> >                 leddc=0x005a000a
> > }
> 
> what about:
> 
> case "$leddc" in
>       '0xffff'*)
>               leddc='0x005a000a'
>       ;;
> esac
> 
> IMHO the approach from felix does not work:
> root@box:~ echo $((0xffff))
> 65535
> root@box:~ echo $((0xffff\n))
> -ash: arithmetic syntax error
> 
> the real would be the fix the output of 'wlc'.

'wlc' is not broken, a simple test case demonstrates it works as expected:

root@e3000-1:~# wlc ifname wl0 leddc
0x005a000a
root@e3000-1:~# wlc ifname wl0 leddc 0xffff
root@e3000-1:~# wlc ifname wl0 leddc
0xffff
root@e3000-1:~# leddc=$(wlc ifname wl0 leddc)
root@e3000-1:~# [ "$leddc" = "0xffff" ] && echo yes
yes
root@e3000-1:~# wlc ifname wl0 leddc 0x005a000a
root@e3000-1:~# wlc ifname wl0 leddc
0x005a000a
root@e3000-1:~# leddc=$(wlc ifname wl0 leddc)
root@e3000-1:~# [ "$leddc" = "0xffff" ] && echo yes
root@e3000-1:~# 

Nathan

> 
> bye bastian
                                          
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to