-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The first line of the script should be
#!/bin/bash

The ifup/down part could also be writting
ifdown eth0 && ifup eth0



Gustin Johnson wrote:
 >> Is there a way. that the Linux machine can monitor the status of the
>> incoming connection from the ISP, and attempt to restore the connection 
>> if it is lost?  And continue to attempt to re-connect to the ISP until 
>> connection is restored (sometimes, this can be hours due to weather). 
> 
> I have done something similar in the past.  A simple shell script that
> cron runs every 5 minutes was my solution.
> 
> In my shell script was a function:
> 
> CheckNet ()
> {
>   ping -c 1 $PINGHOST  >& /dev/null ; # Checking to see if we have net
> connectivity to the backup server
> }
> 
> Then based on the success or failure the script did something else.  On
> a Debian or Ubuntu machine, you could restart the interface with the
> following commands:
> 
> ifdown eth0
> ifup eth0
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIvigbwRXgH3rKGfMRAsXXAJ91h0VJ2pSHZYD3ZmLednd+dFbr6wCgnX5x
E3LqzNUVT4t9/DkozBN+Ebg=
=I4JM
-----END PGP SIGNATURE-----

_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to