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

Button/Leds Script

Discussion in 'Tomato Firmware' started by fluu, Dec 31, 2010.

  1. fluu

    fluu Networkin' Nut Member

    hi,

    I'm using Tomato 1.27.

    Under Administration -> Buttons/Leds i wanted to generate a custom Script.

    It should toggle wireless and the amber led.

    my Script so far: (but doesn't work)
    *******************************************************
    if [ wl radio|grep "radio is off"|wc -l -eq 1 ] ; then
    wl radio on
    led amber on
    else
    wl radio off
    led amber off
    *******************************************************

    Any Ideas?
     
  2. srouquette

    srouquette Network Guru Member

  3. rhester72

    rhester72 Network Guru Member

    There's a bit more to it - there are no backticks around the if.

    Suggested (and optimized for size - save that precious NVRAM!) script:

    Code:
    [ `wl radio|grep -c "radio is off"` -eq 0 ]&&(wl radio off;led amber off)||(wl radio on;led amber on)
    
     
  4. fluu

    fluu Networkin' Nut Member

    thank you, rhester.

    but that can't be the full script, or?! :confused:


    Code:
    [ `wl radio|grep -c "radio is off"` -eq 0 ]&&(wl radio off;led amber off)||(wl radio on;led amber on)
    
     
  5. rhester72

    rhester72 Network Guru Member

    Yep, that's the whole thing!

    Rodney
     

Share This Page