Hi, I have tried script:
*["$ACTION" = "pressed" -a "$BUTTON" = "BUT_2"] && { ["${ACTION}" = "ifup" -a "${INTERFACE}" = "wan"] && { echo "" > /dev/console echo "SWITCH TO RJ45" > /dev/console echo "255" > /sys/devices/platform/leds-gpio/leds/db120:green:status/brightness } & }* *but still no luck :(* Could anyone please figure out what mistakes i am doing. Regards, John On Wed, Sep 16, 2015 at 9:12 AM, John kerry <kerry9...@gmail.com> wrote: > 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 <bitt...@bluebottle.com> > wrote: > >> * John kerry <kerry9...@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@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel