
cat /root/distro/resources/temp.rc.local.add >> /etc/rc.d/rc.local
#update to latest software
yum -y update
) 2>&1 | tee /root/ks_post2.out
b) The cvt_br.sh script, called from the above kickstart, is used to convert an existing
network interface into a bridge
#!/bin/bash
# if 2 parameters were not passed in, display usage
if [[ $# -ne 2 ]]
then
echo "Usage - $0 NIC <bridge>"
exit
fi
#Verify source NIC exists
if [[ ! -f /etc/sysconfig/network-scripts/ifcfg-$1 ]]
then
echo "Error source: /etc/sysconfig/network-scripts/ifcfg-$1 does not exist!"
exit
fi
#Confirm bridge doesn't exists
if [[ -f /etc/sysconfig/network-scripts/ifcfg-$2 ]]
then
echo "Error bridge: /etc/sysconfig/network-scripts/ifcfg-$2 exists!"
exit
fi
#Copy existing NIC network specific info to the bridge file, then append DEVICE, TYPE, and
ONBOOT
grep -e BOOTPROTO -e IPADDR -e NETMASK -e GATEWAY /etc/sysconfig/network-
scripts/ifcfg-$1 > /etc/sysconfig/network-scripts/ifcfg-$2
echo "DEVICE=$2" >> /etc/sysconfig/network-scripts/ifcfg-$2
echo "TYPE=Bridge" >> /etc/sysconfig/network-scripts/ifcfg-$2
echo "ONBOOT=yes" >> /etc/sysconfig/network-scripts/ifcfg-$2
#Remove the network specific info from the NIC and add BRIDGE, BOOTPROTO
mv /etc/sysconfig/network-scripts/ifcfg-$1 /etc/sysconfig/network-scripts/ifcfg-$1.bak
grep -v -e BOOTPROTO -e IPADDR -e NETMASK -e GATEWAY -e ONBOOT
/etc/sysconfig/network-scripts/ifcfg-$1.bak > /etc/sysconfig/network-scripts/ifcfg-$1
echo "BRIDGE=$2" >> /etc/sysconfig/network-scripts/ifcfg-$1
echo "BOOTPROTO=none" >> /etc/sysconfig/network-scripts/ifcfg-$1
c) temp.rc.local.add, also called from the kickstart created in the above step 3a,
contains actions that are executed on the next boot
(
#mount the media
37 www.redhat.com
Komentarze do niniejszej Instrukcji