Router Auto-reboot ideas needed

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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.
 

JohnWill

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

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
 

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.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Top