Hi, Very new to linux but I've just recently setup an ubuntu server.
I have 2 broadband connections and would like to have fallback on the server should one of the lines fail.
I know what I want it to do, but dont know how to script it.
heres the senario;
ubuntu server with 2 ethernet adapters eth0 & eth1
both configured with the same static ip of 192.168.1.8
1 interface is enabled / 1 interface is disabled
the script needs to ;
1. disable eth1 and enable eth0
a. pause to wait for connection to establish
b. invoke dyndns script to upadte dns address
c. if failure_flag='yes' then email to
blah@blah.com detailing ETH1 failure
d. Ping an internet address at a set interval every 5 mins - this should be configurable.
- is the ping successful ?
- Yes - set failure_flag='no' return to step 1d
- No - set failure_flag='yes' move to step 2
2. disable eth0 and enable eth1
a. pause to wait for connection to establish
b. invoke dyndns script to upadte dns addres
c. if failure_flag='yes' then email to
blah@blah.com detailing ETH0 failure
d. Ping an internet address at a set interval every 5 mins
- is the ping successful ?
- Yes - set failure_flag='no' return to step 2d
- No - set failure_flag='yes' return to step 1
Simple in terms of writing it down, but don't have a clue as hoiw to code it.
If anyone is kind enough to help out I would be very gratefull.
Many thanks, ZC