1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Router Auto-reboot ideas needed

Discussion in 'Networking' started by JoJoRaz, Oct 25, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. JoJoRaz

    JoJoRaz Thread Starter

    Joined:
    Oct 25, 2007
    Messages:
    3
    Greetings!
    I'm running a web server on a Mac G4 Powerbook Titanium(Tit), with Ubuntu Linux PPC server OS, so there's no GUI. The Tit is connected to the router via a network switch. I use an XP machine for everything else. The router has a dynamic IP setup where, on boot, it reports the new IP to the name server so the site domain is immediately recognised from the web (Dynamic DNS).
    However, in this part of the world the internet connection is quite unreliable and goes down regularly, whether there's internet activity or not, and I have to reboot the router with telnet or through the router web interface, but it's quicker to pull the plug. The router seems oblivious to the dropped connection as all the indicator lights remain illuminated.

    I need a solution to (1) determine the connection status and, if necessary, (2) telnet the router with the user ID and password to perform a reboot.

    telnet 192.168.1.1
    Username:
    Password:
    reboot
    exit

    I don't want to keep the XP machine on continiously as it's quite power-hungry and we are on solar power, so it will have to be a script, running on the Tit from startup.

    Mac G4 Powerbook (Titanium)
    Xavi X8821r+ Router (Viking)

    Precise instructions if possible please, there seem to be far too many factors to any task in Linux.

    Thanks in advance.
     
  2. JohnWill

    JohnWill Retired Moderator

    Joined:
    Oct 19, 2002
    Messages:
    106,418
    I'd think a simple remote controlled A/C switch might be a lot easier to handle to simply cycle power on the router. :)
     
  3. JoJoRaz

    JoJoRaz Thread Starter

    Joined:
    Oct 25, 2007
    Messages:
    3
    Thanks for the response. I know the script is out there, I've seen it in a foreign language. I just need it explained in clear English (preferably, though not necessarily, the UK version), with no assumptions as to skill-level. I don't really want to reboot the router unnecessarily as it can go days without a problem. I believe 'Expect' is one of the tools required for the job, which I have, but any explanation as to syntax and usage have me reaching for the whiskey bottle (or similar outlet).

    OBJECTIVES
    Monitor connection //possibly ping remote server
    IF no_connection
    telnet 192.168.1.1
    expect User_ID //User ID request from router
    echo User_ID
    expect Password //Password request from router
    echo Password
    expect Login_confirmation //not sure if this is necessary
    reboot
    expect reconnection //not sure if this is necessary
    exit (telnet)
    restart script //with a 10-second delay
    ELSE restart script //with a 10-second delay
     
  4. JohnWill

    JohnWill Retired Moderator

    Joined:
    Oct 19, 2002
    Messages:
    106,418
  5. JoJoRaz

    JoJoRaz Thread Starter

    Joined:
    Oct 25, 2007
    Messages:
    3
    Only that I don't know how. I've tried a few times but I can't find clear enough instructions to get it right. It seems that Expect is not enough alone. There are a few other programs that need to be called to achieve the complete solution. Most explanations require a GUI. I was hoping to find an Expect/Linux/Script/terminal whiz who could make it easier for me....from start to finish.
     
  6. JohnWill

    JohnWill Retired Moderator

    Joined:
    Oct 19, 2002
    Messages:
    106,418
    OK, I can't help you there. :)
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/643173

  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