On 6/18/11 4:17 AM, Linus Nielsen Feltzing wrote: > The /etc/hotplug.d/button/05-3g script is unhappy if the chat script > outputs anything on stdout. I fixed this by redirecting the output from > ifup/ifdown to /dev/null. Without this fix, the 3G/WAN button won't work > on my WRT54G3G with an Aircard 880 modem (since it outputs "SIM ready" > and "PIN set successfully" when connecting). > > Signed-off-by: Linus Nielsen Feltzing <[email protected]> > > --- > > Index: package/comgt/files/3g.button > =================================================================== > --- package/comgt/files/3g.button (revision 27213) > +++ package/comgt/files/3g.button (working copy) > @@ -2,12 +2,12 @@ > # use led for keeping track of the state > case "$(cat /proc/diag/led/3g_green)" in > 1) > - ifdown "$1" > + ifdown "$1" > /dev/null > ifup wan > ;; > 0) > ifdown wan > - ifup "$1" > + ifup "$1" > /dev/null > ;; > esac > )}
I never like the idea of throwing stderr away blindly. If there's a particular message that you know you can safely ignore, I would grep it out. There's a trick for grepping on stderr and keeping it separate from stdout... Let's see if I can find the link... Let's see... here it is: http://hans.fugal.net/blog/2008/08/25/filter-stderr If that doesn't work, the more complicated way is: http://eglug.org/node/946 -Philip _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
