diff --git a/install_shell/set_bonding.sh b/install_shell/set_bonding.sh index 1deff8e..e44c286 100755 --- a/install_shell/set_bonding.sh +++ b/install_shell/set_bonding.sh @@ -1,9 +1,39 @@ #!/bin/sh +export LANG=c + +create_ifcfg(){ +for i in $@; +do +cat > ${IF_CONFIG}/ifcfg-eth${i} <> /etc/sysconfig/modules +if [ -f ${IF_CONFIG}/ifcfg-bond0 ];then + echo "bonding exit.." +else +grep "^bonding" /etc/sysconfig/modules &> /dev/null +if [ $? -eq 0 ];then + echo 'bonding mode=6 max_bonds=1' >> /etc/sysconfig/modules +fi + +mv ${IF_CONFIG}/ifcfg-eth0 ${IF_CONFIG}/ifcfg-bond0 +sed -i "s/^DEVICE=eth0/DEVICE=bond0/g" ${IF_CONFIG}/ifcfg-bond0 + +create_ifcfg 0 2 +fi + -cp ${IF_CONFIG}/bond-examples/ifcfg-bond0 ${IF_CONFIG} -cp ${IF_CONFIG}/bond-examples/ifcfg-eth0 ${IF_CONFIG} -cp ${IF_CONFIG}/bond-examples/ifcfg-eth1 ${IF_CONFIG}