From 361cd8c42bbd926370ac488dd50562e7877185c1 Mon Sep 17 00:00:00 2001 From: linggao Date: Wed, 6 Mar 2013 14:49:46 +0000 Subject: [PATCH] fix for SF bug #3398 updatenode -P fails if hostname on the node is FQDN git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15400 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/xcatdsklspost | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 685328f81..822fc1e17 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -346,18 +346,12 @@ if [ -f /opt/xcat/xcatinfo ]; then node=`grep 'NODE' /opt/xcat/xcatinfo |cut -d= -f2` fi -#try dhcp +#try to get the node ip address that connects to the server. +#then resolve the name of the ip if [ -z "$node" ]; then - #try the dhcp , this is used for initial boot. #find out the ip address of the node for the management nic - NIPS=`grep -h -i fixed-address /var/lib/dhclient/dhclient*eth*.leases 2> /dev/null|awk '{print $2}'|sed -e 's/;//'` - if [ -z "$NIPS" ]; then - NIPS=`grep -h -i fixed-address /var/lib/dhclient/dhclient*hf*.leases 2> /dev/null|awk '{print $2}'|sed -e 's/;//'` - if [ -z "$NIPS" ]; then - NIPS=`grep -h -i IPADDR /var/lib/dhcpcd/*.info 2> /dev/null|awk -F= '{print $2}'|sed -e s/\'//g` - fi - fi - NIP=`echo $NIPS|awk '{printf $NF}' | tail -n 1` #Pick one for wget + NIP=`ip route get $SIP | head -n 1 | sed 's/^.*src//g' | awk {'print $1'} +` if [ -n "$NIP" ]; then #relsove the name of the node from ip address node=`host $NIP | awk {'print $5'} | sed '$s/\.$//'`