From 8a629436e6f72061681b350372c90cb9f0f85668 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 7 Mar 2008 21:24:09 +0000 Subject: [PATCH] -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 --- xCAT/postscripts/hardeths | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 xCAT/postscripts/hardeths diff --git a/xCAT/postscripts/hardeths b/xCAT/postscripts/hardeths new file mode 100644 index 000000000..7c5bbae2f --- /dev/null +++ b/xCAT/postscripts/hardeths @@ -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 +