Cron script to keep/restart wireless clients' connection

Discussion in 'Tomato Firmware' started by ryanq, Oct 1, 2008.

  1. ryanq

    ryanq Addicted to LI Member

    Hi all I am looking to add a script under Init that does these things every 10 minutes or so:

    - looks if a Lan client is connecting properly to the AP, I usually check it with: ping, because the "Device List" is not so trustable
    - if the client responds to pings, yes! it is ok then do nothing
    - if not, then disable wireless from the AP, wait some 10-15 secs then reenable wireless and restart the check.

    would the following be ok?
    Code:
    #START: cycle wireless when connection is hung
    sleep 60
    while [ "`ping -c 3 x.x.x.x |grep 100%`" == "" ]
    do
    sleep 600
    done
    if  "`wl assoclist`" != ""; then
    wl radio off
    sleep 5
    wl radio on
    sleep 10
    fi
    #END: cycle wireless when connection is hung
    Very appreciated any help.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice