Fix, flesh out xcat-cmdline in dracut built variant of nbroot
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10448 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
dd8ba073e3
commit
ef90a6f9a4
@ -6,17 +6,17 @@ echo "<xcatrequest>
|
||||
<command>getdestiny</command>
|
||||
<callback_port>300</callback_port>
|
||||
</xcatrequest>" > /tmp/destreq.xml
|
||||
rm /tmp/destreq.xml
|
||||
while [ ! -f /tmp/destreq.xml ] || grep error /tmp/destiny.xml; do
|
||||
if [ -f /tmp/destreq.xml ]; then
|
||||
if [ -f /tmp/destiny.xml ]; then rm /tmp/destiny.xml; fi
|
||||
while [ ! -f /tmp/destiny.xml ] || grep error /tmp/destiny.xml; do
|
||||
if [ -f /tmp/destiny.xml ]; then
|
||||
timer=60
|
||||
while [ $timer -gt 0 ]; do
|
||||
echo -en "Retrying in $timer seconds \r"
|
||||
echo -en "Retrying in $timer seconds \r" >&2
|
||||
sleep 1
|
||||
timer=$(($timer-1));
|
||||
done
|
||||
fi
|
||||
echo -en " \r";
|
||||
echo " " >&2
|
||||
if [ -f /etc/xcat/cert.pem -a -f /etc/xcat/certkey.pem ]; then #use client cert if available
|
||||
cat /tmp/destreq.xml | openssl s_client -key /etc/xcat/certkey.pem -cert /etc/xcat/cert.pem -connect $XCATDEST -quiet 2> /dev/null > /tmp/destiny.xml
|
||||
else
|
||||
|
@ -6,17 +6,17 @@ echo "<xcatrequest>
|
||||
<command>nextdestiny</command>
|
||||
<callback_port>300</callback_port>
|
||||
</xcatrequest>" > /tmp/destreq.xml
|
||||
rm /tmp/destreq.xml
|
||||
while [ ! -f /tmp/destreq.xml ] || grep error /tmp/destiny.xml; do
|
||||
if [ -f /tmp/destreq.xml ]; then
|
||||
if [ -f /tmp/destiny.xml ]; then rm /tmp/destiny.xml; fi
|
||||
while [ ! -f /tmp/destiny.xml ] || grep error /tmp/destiny.xml; do
|
||||
if [ -f /tmp/destiny.xml ]; then
|
||||
timer=60
|
||||
while [ $timer -gt 0 ]; do
|
||||
echo -en "Retrying in $timer seconds \r"
|
||||
echo -en "Retrying in $timer seconds \r" >&2
|
||||
sleep 1
|
||||
timer=$(($timer-1));
|
||||
done
|
||||
fi
|
||||
echo -en " \r";
|
||||
echo " " >&2;
|
||||
if [ -f /etc/xcat/cert.pem -a -f /etc/xcat/certkey.pem ]; then #use client cert if available
|
||||
cat /tmp/destreq.xml | openssl s_client -key /etc/xcat/certkey.pem -cert /etc/xcat/cert.pem -connect $XCATDEST -quiet 2> /dev/null > /tmp/destiny.xml
|
||||
else
|
||||
|
@ -120,7 +120,7 @@ if [ "$destiny" != "discover" ]; then #we aren't discoverying, we probably can a
|
||||
fi
|
||||
while :; do
|
||||
if [ -z "$destiny" ]; then
|
||||
destiny=`getdestiny`
|
||||
destiny=`getdestiny $XCATMASTER:$XCATPORT`
|
||||
fi
|
||||
destparameter=`echo $destiny|awk -F= '{print $2}'`
|
||||
destiny=`echo $destiny|awk -F= '{print $1}'`
|
||||
@ -133,10 +133,22 @@ while :; do
|
||||
destiny=''
|
||||
/bin/sh
|
||||
elif [ "$destiny" = runcmd ]; then
|
||||
destiny=''
|
||||
destiny=`/bin/nextdestiny $XCATMASTER:$XCATPORT`
|
||||
$destparameter
|
||||
elif [ "$destiny" = runimage ]; then
|
||||
destiny=`/bin/nextdestiny $XCATMASTER:$XCATPORT`
|
||||
mkdir /tmp/`basename $destparameter`
|
||||
cd /tmp/`basename $destparameter`
|
||||
ERROR=`wget $desparamater 2>&1`
|
||||
while [ $? == 1 ] && echo $ERROR|grep -v 416; do
|
||||
sleep 10
|
||||
ERROR=`wget -c $TARG 2>&1`
|
||||
done
|
||||
tar xvf `basename $TARG`
|
||||
./runme.sh
|
||||
cd -
|
||||
elif [ "$destiny" = "reboot" -o "$destiny" = "boot" ]; then
|
||||
/bin/nextdestiny
|
||||
/bin/nextdestiny $XCATMASTER:$XCATPORT
|
||||
reboot -f
|
||||
elif [ "$destiny" = standby ]; then
|
||||
destiny=''
|
||||
|
Loading…
Reference in New Issue
Block a user