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

PPPoE Wan down script

Discussion in 'Tomato Firmware' started by ulyan, Jun 23, 2012.

  1. ulyan

    ulyan Networkin' Nut Member

    I think I solved my problem but the script needs a bit of testing.

    USER - user to connect to telnet
    PASSWORD - password to connect to telnet
    ACTION - depending on your mode : reboot (my case), restart etc
    CLOSING - depending on your modem : logout (my case), close, exit etc
    MODEM - ip of the modem

    reboot() {
            sleep 2
            echo USER
            sleep 2
            echo PASSWORD
            sleep 2
            echo ACTION
            sleep 120
            echo CLOSING
            ) | telnet MODEM
    line=`ifconfig ppp0 | head -3 | head -2 | tail -1`
    ip=`echo $line | cut -d " " -f 2 | cut -d ":" -f 2`
    if [ -z $ip ]
    If you find it is not working please tell me. Anyway I'll do more testing. I've put it in the Scheduler section in Administration on a custom box and it checks state every one minute.

    -----------------------------------------THE PROBLEM----------------------

    What I want to do is simple I guess, thing is I don't know where to start. What i want is that when my modem hangs, or my connection hangs and
    Tomato is not able to reconnect given any reason, I want to add a script in the Scheduler area that runs every x minutes and if wan is down or whatever it connects via telnet and reboots the router.

    This is the reproduced problem:

Share This Page