#! /bin/bash
#
# Server_Failover: Set this server to take over for
#   the failed Master server (127.162.203.209 on eth1)
#
######
#
# The files are stored in /root/..
#
#   /root/config/ contains the network information
#     that is specific to this fail-over server
#     (the only information that is different
#     from the master) 
#
#   /root/master_backup/ contains the latest backup
#     image from the master server
#
# Write over the configs from the master_backup
# then reset the network back to the fail-over.
#
cd /
cp -a /root/config/network.failover /etc/sysconfig/network
cp -a /root/config/ifcfg-eth1.failover /etc/sysconfig/network-scripts/ifcfg-eth1

# Restart the Network and Squid services after the configuration update
/etc/rc.d/init.d/network restart
/etc/rc.d/init.d/squid restart
