1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Controlling LEDs

Discussion in 'HyperWRT Firmware' started by TommyN, Oct 7, 2007.

  1. TommyN

    TommyN Network Guru Member

    Today I tried controlling the LEDs on my WRT54GL.
    I now use the script from Thibor:

    #!/bin/sh
    I=`nvram get wl0_ifname`
    while sleep 1; do
    if [ "`wl assoclist`" != "" ]; then
    XFER=`ifconfig $I|grep bytes`
    if [ "$XFER" != "$PXFER" ]; then
    LED="am on wh on"
    PXFER=$XFER
    else
    LED="am on wh of"
    fi
    else
    LED="am of wh of"
    fi
    if [ "$LED" != "$PLED" ]; then
    led $LED
    PLED=$LED
    fi
    done

    My question is now, how do I modify it to turn on the amber led when wireless is on and turn on the white led when a wireless user is connected?
     
  2. Low-WRT

    Low-WRT LI Guru Member

    I know this isn't exactly what you are looking for, but it may be a start...I can't write scripts, I can only cut and paste them. :)
    I use this to have a white light when a wireless client is connected and orange otherwise:

    while sleep 45; do
    if [ "`wl assoclist`" != "" ]; then
    led amber off white on
    else
    led amber on white off
    fi
    done
     
  3. TommyN

    TommyN Network Guru Member

    That's a pretty good feature too. I'll try that :)
     

Share This Page