[go: up one dir, main page]

Menu

[r2]: / cpy / change  Maximize  Restore  History

Download this file

105 lines (105 with data), 4.9 kB

#
# VMLMAT: VM Linux Management and Archival Tool.
# Copyright (c) 2007, Ronnie Michael, BMC Software Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the # # following conditions are met:
#
#  * Redistributions of source code must retain the above copyright notice, this list of conditions and the  following disclaimer.
#  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#  * Neither the name of the BMC Software Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# This routine is called by bkclone to change the hostname and IPaddress
# /tmp/change.input is created by bkgen from the request file.
#
# Edit this code if needed
# this currently supports  SuSE SLES 7,8,9,10
# and below additional support for Redhat AS 3, 4, 5
# and similar CentOS releases.
#
echo change script begins
cd /mnt/new/etc 
#
# chandevv.conf is only needed if you use ctc instead of qdio/qeth
#
if [  -e "chandev.conf" ]; then
sed -f /tmp/change.input chandev.conf > /tmp/work                               
cp /tmp/work chandev.conf 
fi
#
# SLES7 needs the broadcast and gateway in route.conf
# example:
#default                 10.200.0.253             0.0.0.0                 eth0
#10.200.0.0              0.0.0.0                 255.255.252.0           eth0
#
# IT is assumed that the these do not need to change from backup to restore.
#
if [  -e "route.conf" ]; then
sed -f /tmp/change.input route.conf > /tmp/work                               
cp /tmp/work route.conf 
fi
if [  -e "hosts" ]; then                                                
sed -f /tmp/change.input hosts > /tmp/work                                      
cp /tmp/work hosts 
fi
if [  -e "httpd.conf" ]; then                                                             
sed -f /tmp/change.input httpd/httpd.conf > /tmp/work                           
cp /tmp/work httpd/httpd.conf 
fi
if [  -e "modules.conf" ]; then                                                  
sed -f /tmp/change.input modules.conf > /tmp/work                               
cp /tmp/work modules.conf 
fi
#
# SLES7 SuSEconfig command reads rc.config and executes sbin/conf.d/SuSEconfig.* files and updates etc/yp.conf
# and etc/resolv.conf if not modified.
#
if [  -e "rc.config" ]; then                                                  
sed -f /tmp/change.input rc.config > /tmp/work                               
cp /tmp/work rc.config 
fi
#
# This following statement relies on the F000,F001,F002 qdio/qeth addresses
#
if [  -e "sysconfig/network/ifcfg-qeth-bus-ccw-0.0.f000" ]; then                                                      
sed -f /tmp/change.input sysconfig/network/ifcfg-qeth-bus-ccw-0.0.f000 > /tmp/work               
cp /tmp/work sysconfig/network/ifcfg-qeth-bus-ccw-0.0.f000  
fi
if [  -e "sysconfig/network/ifcfg-eth0" ]; then                    
sed -f /tmp/change.input sysconfig/network/ifcfg-eth0 > /tmp/work               
cp /tmp/work sysconfig/network/ifcfg-eth0  
fi
if [  -e "sysconfig/network/routes" ]; then                                     
sed -f /tmp/change.input sysconfig/network/routes > /tmp/work                   
cp /tmp/work sysconfig/network/routes 
fi
if [  -e "HOSTNAME" ]; then                                          
sed -f /tmp/change.input HOSTNAME > /tmp/work                                   
cp /tmp/work HOSTNAME
fi
#
# Edit this code if needed
# this currently supports Redhat AS 3 and 4 
#
if [  -e "sysconfig/network" ]; then
sed -f /tmp/change.input sysconfig/network > /tmp/work                   
cp /tmp/work sysconfig/network
fi
if [  -e "sysconfig/network-scripts/ifcfg-eth0" ]; then                                           
sed -f /tmp/change.input sysconfig/network-scripts/ifcfg-eth0 > /tmp/work
cp /tmp/work sysconfig/network-scripts/ifcfg-eth0  
fi  
echo change script has ended