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

Bastian Bittorf bittorf at bluebottle.com
Tue Sep 15 07:51:55 EDT 2015


* 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
_______________________________________________
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