[OpenWrt-Devel] OpenWrt /etc/hotplug.d/button/00-wps
John kerry
kerry9842 at gmail.com
Tue Sep 15 21:12:49 EDT 2015
Hi,
I have changed the script as below:
MYDEV='eth0.2'
["$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" -a "INTERFACE" = 'wan'] &&
{
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.
Could you please correct it me.
Regards,
John
On Tue, Sep 15, 2015 at 7:51 PM, Bastian Bittorf <bittorf at bluebottle.com>
wrote:
> * John kerry <kerry9842 at gmail.com> [15.09.2015 13:44]:
> > Hi,
> >
> > I have added following condition but its not working:
> >
> > MYDEV='eth0'
> >
> > if [ "$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" ] && {
> ^^^^ remove the 'if'
> > devstatus "$MYDEV" | grep '"up": true' && {
> > echo "255" >
> > /sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
> > }
> > }
> >
> > fi
> ^^^^ remove the 'fi'
>
> please change the first line to e.g.
> [ "$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" -a "$INTERFACE" = 'wan' ]
> && {
>
> INTERFACE is the 'name' of the device, e.g. 'wan' or 'lan'
> DEVICE is the real thing, e.g. eth0.1
>
> > Am i doing any mistake or need to change anything
>
> you can always TEST you script with e.g.
>
> set -x
> INTERFACE=bla
> DEVICE=blubb
> . name_of_your_script
> set +x
>
> bye, bastian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150916/7b6feb61/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