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