<div dir="ltr"><div><div><div><div><div><div>Hi ,<br><br></div>[ "$ACTION" = "pressed" ] && [ "$BUTTON" = "lanwifi" ] && [ "$INTERFACE" = "wan" ] &&<br> {<br> devstatus "$MYDEV" | grep '"up": true' &&<br> {<br><br> echo "" > /dev/console<br> echo "SWITCH TO RJ45" > /dev/console<br> echo "255" > /sys/devices/platform/leds-gpio/leds/db120:green:status/brightness<br> }<br> }<br><br></div>even i checked on <a href="http://www.shellcheck.net/">http://www.shellcheck.net/</a> , its not giving any feedback, it seems correct but still its not working.<br><br></div>I writing this script under /etc/hotplug.d/button/50-button file.<br><br></div>I have to change any other file?<br><br></div>Regards,<br></div>john<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 16, 2015 at 2:43 PM, Bastian Bittorf <span dir="ltr"><<a href="mailto:bittorf@bluebottle.com" target="_blank">bittorf@bluebottle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">* John kerry <<a href="mailto:kerry9842@gmail.com">kerry9842@gmail.com</a>> [16.09.2015 08:10]:<br>
<span class="">> Hi,<br>
><br>
> I have changed the script as below:<br>
><br>
> MYDEV='eth0.2'<br>
><br>
> ["$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" -a "INTERFACE" = 'wan'] &&<br>
</span> ^^^ a space here, so [ "$ACTION" - the same at the end: 'wan' ]<br>
use "$INTERFACE" with the '$'<br>
<br>
please learn shell-scripting. maybe it's an good idea to use a static<br>
checker like <a href="http://www.shellcheck.net/" rel="noreferrer" target="_blank">http://www.shellcheck.net/</a><br>
<span class=""><br>
> {<br>
> devstatus "$MYDEV" | grep '"up": true' &&<br>
> {<br>
> echo "255" ><br>
> /sys/devices/platform/leds-gpio/leds/db120:green:status/brightness<br>
> }<br>
> }<br>
><br>
><br>
> but its not working.<br>
><br>
> What mistake i am doing.<br>
<br>
</span>bye, bastian - greetings to china?!<br>
</blockquote></div><br></div>