Koozali.org: home of the SME Server

Internet connection script?

Bill Talcott

Internet connection script?
« on: December 30, 2002, 08:41:46 AM »
I learn mostly by modifying what I find to do what I'd like. However, in some cases it's best to let the people who know what they're doing handle things. =)

I'd like to make a script that checks for an internet connection (pings the ISP's server?), and runs another script if the connection is down.

I'm assuming this is a very basic task for some of you, and would appreciate any suggestions, instead of trying to hack my way through this on my own...

guestHH

Re: Internet connection script?
« Reply #1 on: December 30, 2002, 02:53:01 PM »
Hi Bill,

I would be interested in that too. I have a buggy internet connection at 1 location. I would like to check the connection and if down, bring it up.

I was thinking of making a crontab entry to execute a little script like:

*/5    *  *  *  *  root   /usr/local/scripts/myscript

so myscript is executed every 5 minutes.

Any suggestions?

Regards,
guestHH

Bill Talcott

Re: Internet connection script?
« Reply #2 on: December 30, 2002, 05:27:32 PM »
Bill Talcott wrote:
>
> I learn mostly by modifying what I find to do what I'd like.

Well, after looking at the internet test section of /sbin/e-smith/console, I don't think I'm any smarter. Still looking for input from someone who knows what they're doing. =)

Kelvin

Re: Internet connection script?
« Reply #3 on: December 31, 2002, 03:23:10 AM »
Hi Guys,

This actually came up before. I use a variation of the following script for my purposes :-

http://www.hlinstruments.com/brian/stayalive/

Happy New Year !

Kelvin

guestHH

Re: Internet connection script?
« Reply #4 on: December 31, 2002, 03:37:19 AM »
Thans Kelvin.

That came up before indeed, I remembered when I saw it.
May I ask what modifications you made? I only have 1 broadband link to test....

'.au' means the first one drinking champagne right...;-)

Happy new year!

tia

Regards,
guestHH

Kelvin

Re: Internet connection script?
« Reply #5 on: December 31, 2002, 03:58:09 AM »
Hi HF,

I've got my scripts mixed up. While the script I pointed out to you was the right one for what you were after, I was actually referring to a different script that I modified to keep a connection alive (has to do with installing a PPTP client onto the SME server so that all masqed clients on the LAN can access a particular service without needing to VPN in individually (which they cannot do if they are all behind the one SME server and PPTP being the only protocol available - no IPSec, etc).

As for champagne tonight,
1. I don't drink alcohol at all (except when it was in cough mixtures !)
2. Too tired - worked a lot over the Christmas period - late nights
3. 2 kids under 5 :-)
..... 'nuff said.

Cheers,

Kelvin

Bill Talcott

Re: Internet connection script?
« Reply #6 on: December 31, 2002, 08:48:15 AM »
Kelvin wrote:
>
> Hi Guys,
>
> This actually came up before. I use a variation of the
> following script for my purposes :-
>
> http://www.hlinstruments.com/brian/stayalive/
>
> Happy New Year !
>
> Kelvin

Thanks! Now that I see it, I remember looking at this before... Now that I've found a way to reset the cablemodem via SNMP (which from everything I've read should not be allowed), I think I'll be able to have a pretty cool setup.