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

What's wrong with this script?

Discussion in 'Tomato Firmware' started by GhaladReam, Apr 18, 2007.

  1. GhaladReam

    GhaladReam Network Guru Member

    I'm not sure if it's Tomato 1.06 or if the script has changed, but I've been using an Init script in Tomato ever since I can remember, and it stopped working properly once I upgraded to 1.06.

    The script is as follows:

    Code:
    #!/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
    
    I got that script from Thibor's website, and it has worked flawlessly in Tomato prior to 1.06. What it's supposed to do it make it so the SES/Cisco light is Amber when a wireless client is connected, white when data is being transferred wirelessly, and dark when no wireless clients are connected. As it stands, in 1.06, the SES light does go dark with no wireless clients connected, but when wireless clients ARE connected, it's always white. It never turns amber. It's as if it thinks wireless data is constantly being transferred. Now, I know that is not the case, because I've done some analysis, and it's white 100% of the time now. I've tried resetting the NVRAM and re-keying all my settings, and nothing has worked thus far.

    Is there something I need to change in that script to make it work that affects something that was changed in Tomato 1.06? I don't know too much about Linux, so I wouldn't know what to change.

    I'm on a WRT54GS v2.0.

    Thanks in advance!

    P.S. I know I already posted about this is the Tomato Bugs thread, I just wanted some feedback on this as well.
     
  2. Reiper

    Reiper LI Guru Member

    Try this...

    #!/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="amber on white on"
    PXFER=$XFER
    else
    LED="amber on white off"
    fi
    else
    LED="amber off white off"
    fi
    if [ "$LED" != "$PLED" ]; then
    led $LED
    PLED=$LED
    fi
    done
     
  3. GhaladReam

    GhaladReam Network Guru Member

    Success!

    That worked perfectly. It looks like the abbreviations for amber and white were removed from 1.06 for some reason. Nevertheless, it works perfectly now.

    Thanks!
     
  4. GhaladReam

    GhaladReam Network Guru Member

    D'oh!!

    Just after posting my last post in this thread I realize I had 2 private messages from other users telling me how to fix this from my previous post about this.. And there was another user having this problem.

    Methinks I need to do a more in-depth search before making threads in the future..
     

Share This Page