Auto Reconnect every 20 minutes (script)

Discussion in 'Tomato Firmware' started by SteelRAT, Jul 6, 2007.

  1. SteelRAT

    SteelRAT Network Guru Member

    I am looking for a script that will make my router reconnect to my provider every 20 minutes. Can anybody help me?

  2. ntest7

    ntest7 Network Guru Member

    What's it take to reconnect to your provider? Just some web activity? Try this for an init script (Administration->Scripts/ Init):

    while true ; do /bin/sleep 1200
    /usr/bin/wget -O - > /dev/null

    Or some other smallish web site. The google page is currently about 5k.
    You might could use "/bin/ping -c 1 > /dev/null" instead of the wget command, but some dialers ignore ping.
  3. yaqui

    yaqui LI Guru Member

    Try this... place the script under init and reboot your router... every 20 minutes it should shut down connection for 5 minutes (to avoid creating a virtual connection) then reconnect:

    sleep 5
    echo -e "#!/bin/sh\n while true \; do sleep 1200" > /tmp/
    echo -e "service wan stop" >> /tmp/
    echo -e "logger \'wan stop success\'" >> /tmp/
    echo -e "sleep 300" >> /tmp/
    echo -e "service wan start" >> /tmp/
    echo -e "logger \'wan restart successful\'" >> /tmp/
    echo -e "done" >> /tmp/
    chmod 755 /tmp/

    Let me know if that works !
  4. yaqui

    yaqui LI Guru Member

    Does my script work ? :/
  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