From c72e01429a52a7e893a5f51a4a098c3b89b1965e Mon Sep 17 00:00:00 2001 From: jjhua Date: Thu, 22 Nov 2012 08:01:30 +0000 Subject: [PATCH] for linux diskless, make getpostscript.awk use the template method, instad of the original method git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14397 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/xcatdsklspost | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 3ddb7795a..65a17bed7 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -96,7 +96,7 @@ download_mypostscript() 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 + 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 @@ -109,8 +109,8 @@ download_mypostscript() break fi - SLI=$(awk 'BEGIN{srand(); printf("%d\n",rand()*5)}') - sleep $SLI + #SLI=$(awk 'BEGIN{srand(); printf("%d\n",rand()*5)}') + #sleep $SLI done return $rc } @@ -332,7 +332,16 @@ fi if [ ! -x /xcatpost/mypostscript ]; then -/xcatpost/getpostscript.awk | egrep '' | sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /xcatpost/mypostscript; +#/xcatpost/getpostscript.awk | egrep '' | sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /xcatpost/mypostscript; +/xcatpost/getpostscript.awk > /dev/null +node=`hostname` +echo "$node\n" +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 +fi + MYCONT=`grep MASTER /xcatpost/mypostscript` #echo "MYCONT=$MYCONT" #if getpostscript.awk fails, the postscript will fall into infinit loop @@ -353,7 +362,14 @@ while [ -z "$MYCONT" ]; do #SLI=$((10 + $SLI)) #sleep $SLI - /xcatpost/getpostscript.awk | egrep '' | sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /xcatpost/mypostscript; + #/xcatpost/getpostscript.awk | egrep '' | sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /xcatpost/mypostscript; + /xcatpost/getpostscript.awk > /dev/null + 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 + fi + MYCONT=`grep MASTER /xcatpost/mypostscript` if [ ! -z "$MYCONT" ]; then break;