From 24a5be82a23f5d88a5f4e5020dcf23777bfce307 Mon Sep 17 00:00:00 2001 From: jjhua Date: Thu, 17 Jan 2013 09:20:12 +0000 Subject: [PATCH] fixd bug 3291, when run getpostscript.awk version2, create mypostscripts.nodename.tmp and get the mypostscripts.nodename.tmp later insteadf of mypostscripts.nodename git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14909 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/xcatdsklspost | 38 ++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 087571f3e..137516484 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -80,8 +80,9 @@ download_mypostscript() { server=$1 node=$2 - max_retries=$3 - TFTPDIR=$4 + postfix=$3 + max_retries=$4 + TFTPDIR=$5 if [ -z $server ]; then return 1; fi @@ -95,15 +96,23 @@ download_mypostscript() #node=`hostname` while [ 0 -eq 0 ]; do - - wget -N --waitretry=10 --random-wait -T 60 http://$server$TFTPDIR/mypostscripts/mypostscript.$node -P /xcatpost 2>> /tmp/wget.log - rc=$? - - if [ $rc -eq 0 ]; then - mv /xcatpost/mypostscript.$node /xcatpost/mypostscript - return 0; - fi + if [ $postfix -eq 0 ]; then + wget -N --waitretry=10 --random-wait -T 60 http://$server$TFTPDIR/mypostscripts/mypostscript.$node -P /xcatpost 2>> /tmp/wget.log + rc=$? + if [ $rc -eq 0 ]; then + mv /xcatpost/mypostscript.$node /xcatpost/mypostscript + return 0; + fi + elif [ $postfix -eq 1 ];then + wget -N --waitretry=10 --random-wait -T 60 http://$server$TFTPDIR/mypostscripts/mypostscript.$node.tmp -P /xcatpost 2>> /tmp/wget.log + rc=$? + if [ $rc -eq 0 ]; then + mv /xcatpost/mypostscript.$node.tmp /xcatpost/mypostscript + return 0; + fi + fi + retry=$(($retry+1)) if [ $retry -eq $max_retries ]; then break @@ -327,7 +336,8 @@ rm -rf /xcatpost/mypostscript node=`hostname` max_retries=2 -download_mypostscript $SIP $node $max_retries $TFTPDIR +postfix=0 +download_mypostscript $SIP $node $postfix $max_retries $TFTPDIR @@ -364,7 +374,8 @@ if [ ! -x /xcatpost/mypostscript ]; then #/xcatpost/getpostscript.awk | egrep '' | sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /xcatpost/mypostscript; /xcatpost/getpostscript.awk version2 > /dev/null max_retries=1 -download_mypostscript $SIP $node $max_retries $TFTPDIR +postfix=1 +download_mypostscript $SIP $node $max_retries $postfix $TFTPDIR MYCONT=`grep MASTER /xcatpost/mypostscript` #echo "MYCONT=$MYCONT" @@ -389,7 +400,8 @@ while [ -z "$MYCONT" ]; do #/xcatpost/getpostscript.awk | egrep '' | sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /xcatpost/mypostscript; /xcatpost/getpostscript.awk version2 > /dev/null max_retries=1 - download_mypostscript $SIP $node $max_retries $TFTPDIR + postfix=1 + download_mypostscript $SIP $node $max_retries $postfix $TFTPDIR MYCONT=`grep MASTER /xcatpost/mypostscript` if [ ! -z "$MYCONT" ]; then