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

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?
    #START: cycle wireless when connection is hung
    sleep 60
    while [ "`ping -c 3 x.x.x.x |grep 100%`" == "" ]
    sleep 600
    if  "`wl assoclist`" != ""; then
    wl radio off
    sleep 5
    wl radio on
    sleep 10
    #END: cycle wireless when connection is hung
    Very appreciated any help.

Share This Page