-Have a hardeths script available

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@731 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-03-07 21:24:09 +00:00
parent 180ac3aea2
commit 8a629436e6

View File

@ -0,0 +1,9 @@
for nic in `ifconfig -a|grep -B1 "inet addr"|awk '{print $1}'|grep -v inet|grep -v -- --|grep -v lo`; do
IPADDR=`ifconfig $nic |grep "inet addr"|awk '{print $2}' |awk -F: '{print $2}'`
NETMASK=`ifconfig $nic |grep "inet addr"|awk '{print $4}' |awk -F: '{print $2}'`
sed -i s/BOOTPROTO=dhcp/BOOTPROTO=none/ /etc/sysconfig/network-scripts/ifcfg-$nic
echo IPADDR=$IPADDR >> /etc/sysconfig/network-scripts/ifcfg-$nic
echo NETMASK=$NETMASK >> /etc/sysconfig/network-scripts/ifcfg-$nic
done
sed -i "s/HOSTNAME.*/HOSTNAME=`hostname`/" /etc/sysconfig/network