From aa9407acf8a29e80f7e2a20b4fd4a6b2c7fbfff9 Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 2 Mar 2010 11:29:01 +0000 Subject: [PATCH] primarynic and installnic can be set to mac address git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5330 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/install/scripts/post.rh | 2 ++ xCAT-server/share/xcat/install/scripts/post.sles | 2 ++ xCAT-server/share/xcat/install/scripts/post.sles11 | 2 ++ 3 files changed, 6 insertions(+) diff --git a/xCAT-server/share/xcat/install/scripts/post.rh b/xCAT-server/share/xcat/install/scripts/post.rh index b9b4afeb9..269fe8fa1 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rh +++ b/xCAT-server/share/xcat/install/scripts/post.rh @@ -6,6 +6,8 @@ export PRINIC=#TABLE:noderes:THISNODE:primarynic# if [ -z "$PRINIC" ] then export PRINIC=eth0 +elif [[ `echo "$PRINIC" | grep -sqE ^[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+$ ;echo $?` == "0" ]]; then + export PRINIC=`ifconfig -a | grep -i "HWaddr $PRINIC" | awk '{print $1}'` fi IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') if [ -z $IP ] diff --git a/xCAT-server/share/xcat/install/scripts/post.sles b/xCAT-server/share/xcat/install/scripts/post.sles index 9b412c661..110eca9b5 100644 --- a/xCAT-server/share/xcat/install/scripts/post.sles +++ b/xCAT-server/share/xcat/install/scripts/post.sles @@ -19,6 +19,8 @@ EOF export PRINIC=#TABLE:noderes:$NODE:primarynic# if [ -z "$PRINIC" ]; then export PRINIC=eth0 +elif [[ `echo "$PRINIC" | grep -sqE ^[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+$ ;echo $?` == "0" ]]; then + export PRINIC=`ifconfig -a | grep -i "HWaddr $PRINIC" | awk '{print $1}'` fi if [ "$PRINIC" != "eth0" ] then diff --git a/xCAT-server/share/xcat/install/scripts/post.sles11 b/xCAT-server/share/xcat/install/scripts/post.sles11 index 60433f353..0c45e463d 100644 --- a/xCAT-server/share/xcat/install/scripts/post.sles11 +++ b/xCAT-server/share/xcat/install/scripts/post.sles11 @@ -19,6 +19,8 @@ EOF export PRINIC=#TABLE:noderes:$NODE:primarynic# if [ -z "$PRINIC" ]; then export PRINIC=eth0 +elif [[ `echo "$PRINIC" | grep -sqE ^[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+$ ;echo $?` == "0" ]]; then + export PRINIC=`ifconfig -a | grep -i "HWaddr $PRINIC" | awk '{print $1}'` fi if [ "$PRINIC" != "eth0" ] then