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

Help with wireless script

Discussion in 'Tomato Firmware' started by Low-WRT, Sep 1, 2007.

  1. Low-WRT

    Low-WRT LI Guru Member

    I just hooked up my old desktop for my wife to use in her "office". It doesn't have a wireless card, so I'm using a fonera w/ dd-wrt as a wireless bridge.

    My AP is a gl running tomato. I have this script running, which I love. However, it always shows a connected client, when I only want it to work when a laptop is connected. How can I modify this script to ignore the mac of the wireless bridge?
    Thanks!

    I=`nvram get wl0_ifname`
    while sleep 1; do
    if [ "`wl assoclist`" != "" ]; then
    XFER=`ifconfig $I|grep bytes`
    if [ "$XFER" != "$PXFER" ]; then
    LED="amber off 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
     
  2. yaqui

    yaqui LI Guru Member

    Code:
    I=`nvram get wl0_ifname`
    while sleep 1; do
    minusbridge=$(wl assoclist | grep -v <your wireless bridge mac here>)
    if [ -n "$minusbridge" ] ; then
    XFER=`ifconfig $I|grep bytes`
    if [ "$XFER" != "$PXFER" ]; then
    LED="amber off 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
    Try that.
     
  3. Low-WRT

    Low-WRT LI Guru Member

    Thanks for the quick reply...I didn't get to try it until tonight, but it didn't work. Here's what I tried:

    I=`nvram get wl0_ifname`
    while sleep 1; do
    minusbridge=$(wl assoclist | grep -v 192.168.2.121)
    if [ -n "$minusbridge" ] ; then
    XFER=`ifconfig $I|grep bytes`
    if [ "$XFER" != "$PXFER" ]; then
    LED="amber off 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
     
  4. GhaladReam

    GhaladReam Network Guru Member

    By the looks of it, you put in an IP address where the code said to put in a MAC address. IP addresses and MAC's are 2 different things. Your mac should be in xx-xx-xx-xx-xx-xx format.
     
  5. danix71

    danix71 LI Guru Member

    Right.
    Or xx:xx:xx:xx:xx:xx ; anyway, MAC has 12 digits, not 4 numbers like the IP adress.
     
  6. Low-WRT

    Low-WRT LI Guru Member

    Doh!:blush:
    That went right by me. Thanks for the help, I'm sure it'll work now!
     
  7. danix71

    danix71 LI Guru Member

    Glad we could help. :) Anyway, yaqui has some other great stuff (scripts). Thanks yaqui !
     
  8. Low-WRT

    Low-WRT LI Guru Member

    It worked! Thanks a lot.
     

Share This Page