[OpenWrt-Devel] OpenWrt /etc/hotplug.d/button/00-wps

John kerry kerry9842 at gmail.com
Wed Sep 16 04:12:56 EDT 2015


Hi ,

[ "$ACTION" = "pressed" ] && [ "$BUTTON" = "lanwifi" ] && [ "$INTERFACE" =
"wan" ] &&
  {
     devstatus "$MYDEV" | grep '"up": true' &&
     {

        echo "" > /dev/console
        echo "SWITCH TO RJ45" > /dev/console
        echo "255" >
/sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
      }
   }

even i checked on http://www.shellcheck.net/ , its not giving any feedback,
it seems correct but still its not working.

I writing this script under /etc/hotplug.d/button/50-button file.

I have to change any other file?

Regards,
john

On Wed, Sep 16, 2015 at 2:43 PM, Bastian Bittorf <bittorf at bluebottle.com>
wrote:

> * John kerry <kerry9842 at gmail.com> [16.09.2015 08:10]:
> > Hi,
> >
> > I have changed the script as below:
> >
> > MYDEV='eth0.2'
> >
> >  ["$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" -a "INTERFACE" = 'wan'] &&
>    ^^^ a space here, so [ "$ACTION" - the same at the end: 'wan' ]
> use "$INTERFACE" with the '$'
>
> please learn shell-scripting. maybe it's an good idea to use a static
> checker like http://www.shellcheck.net/
>
> >    {
> >         devstatus "$MYDEV" | grep '"up": true' &&
> >        {
> >             echo "255" >
> > /sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
> >         }
> >     }
> >
> >
> > but its not working.
> >
> > What mistake i am doing.
>
> bye, bastian - greetings to china?!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150916/8eea7d41/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list