From 5d3221ec32adf96e4953b48adac061814ace27ec Mon Sep 17 00:00:00 2001 From: daniceexi Date: Tue, 1 Nov 2011 06:20:20 +0000 Subject: [PATCH] add code to get parameters from the ENV that set by the postscript mechanism during the install/boot/updatenode when the xHRM is called as a postscript git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10946 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/scripts/xHRM | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/xHRM b/xCAT-server/share/xcat/scripts/xHRM index 7d538c1d2..38b1f5227 100755 --- a/xCAT-server/share/xcat/scripts/xHRM +++ b/xCAT-server/share/xcat/scripts/xHRM @@ -54,14 +54,30 @@ if [ "storageprereq" = "$1" ]; then mount $MOUNTPATH /var/lib/xcat/vmnt/$DIRNAME elif [ "bridgeprereq" = "$1" ]; then NETDESC="$2" + # get the port for installation + if [ -n "$INSTALLNIC" ]; then + if [[ "$INSTALLNIC" = mac ]] || [[ "$INSTALLNIC" = MAC ]]; then + INSPORT=`ifconfig -a|grep -v inet6| grep -i 'HWaddr '$MACADDRESS|head -n 1|awk '{print $1}'` + else + INSPORT=$INSTALLNIC + fi + fi + if [ -z "$NETDESC" ]; then - echo "Incorrect usage" - exit 1 + if [ -n "$INSTALLNIC" ]; then + NETDESC=$INSPORT:default + else + echo "Incorrect usage" + exit 1 + fi fi if echo "$NETDESC"|grep ':'> /dev/null; then PORTS=`echo "$NETDESC"|cut -d: -f 1` BNAME=`echo "$NETDESC"|cut -d: -f 2` else + if [ -n "$INSTALLNIC" ]; then + PORTS=$INSPORT + fi BNAME=$NETDESC fi if brctl showstp "$BNAME" > /dev/null; then