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

John kerry kerry9842 at gmail.com
Tue Sep 15 02:16:52 EDT 2015


I have written the following condition in /etc/hotplug.d/button/50-wps file
if [ "$ACTION" = "pressed" -a "$BUTTON" = "lanwifi" ]; then
        echo "" > /dev/console
        echo "SWITCH TO RJ45" > /dev/console
        echo "255" >

So Now whenever i pressed button the Status LED will glow otherwise OFF.

But i need to check one more condition eth0 link UP/Down, If UP only i have
to ON the status LED.

Could anyone please tell how i can add such condition in this script.


On Tue, Sep 15, 2015 at 2:00 PM, John kerry <kerry9842 at gmail.com> wrote:

> Hi,
> I have to write some condition in
> /etc/hotplug.d/button/50-wps/ file
> I have to configure cat /etc/hotplug.d/button/00-wps file for following
> condition:
> if [ "$BUTTON" = "BTN_2" ] && [ "$ACTION" = "pressed" ]; then
> I have to check eth0.1 if link is up then have ON status led otherwise OFF.
> I am able ON/OFF Status LED based on eth0 link up/down using below
> config led 'led_status'
>         option name 'STATUS'
>         option interval '50'
>         option sysfs 'wndr3700:green:status'
>         option default '0'
>         option trigger 'netdev'
>         option mode 'link'
>         option dev 'eth0'
>  But i need to check first above button that is pressed only i have to
> check eth0 status.
> I am not able to mix both condition in one place.
> Could anyone please reply, how i can add such condition in that file.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150915/f811df10/attachment.htm>
-------------- next part --------------
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list