From 7eb3ffaaa1fcf8fe9cc80cd1e817013a16f594e1 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 31 Aug 2011 20:31:54 +0000 Subject: [PATCH] Add getdestiny/nextdestiny back in, most of the way there to nbroot successor git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10422 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-nbroot2/getdestiny | 26 ++++++++++++++++++++++++++ xCAT-nbroot2/install | 2 ++ xCAT-nbroot2/nextdestiny | 26 ++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100755 xCAT-nbroot2/getdestiny create mode 100755 xCAT-nbroot2/nextdestiny diff --git a/xCAT-nbroot2/getdestiny b/xCAT-nbroot2/getdestiny new file mode 100755 index 000000000..e780f0f30 --- /dev/null +++ b/xCAT-nbroot2/getdestiny @@ -0,0 +1,26 @@ +#!/bin/bash +if [ -z "$XCATDEST" ]; then + XCATDEST=$1 +fi +echo " +getdestiny +300 +" > /tmp/destreq.xml +rm /tmp/destreq.xml +while [ ! -f /tmp/destreq.xml ] || grep error /tmp/ipmicfg.xml; do + if [ -f /tmp/destreq.xml ]; then + echo -n "Retrying in 60 seconds..."; + timer=60 + while [ $timer -gt 0 ]; do + sleep 1 + echo -n . + timer=$(($timer-1)); + done + fi + 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/ipmicfg.xml + else + cat /tmp/destreq.xml | openssl s_client -connect $XCATDEST -quiet 2> /dev/null > /tmp/ipmicfg.xml + fi +done +rm /tmp/destreq.xml diff --git a/xCAT-nbroot2/install b/xCAT-nbroot2/install index ea47f8770..8b3b85d20 100755 --- a/xCAT-nbroot2/install +++ b/xCAT-nbroot2/install @@ -589,6 +589,8 @@ inst "$moddir/minixcatd.awk" "/bin/minixcatd.awk" inst "$moddir/bmcsetup" "/bin/bmcsetup" inst "$moddir/allowcred.awk" "/bin/allowcred.awk" inst "$moddir/getipmi" "/bin/getipmi" +inst "$moddir/getdestiny" "/bin/getdestiny" +inst "$moddir/nextdestiny" "/bin/nextdestiny" inst "$moddir/getcert" "/bin/getcert" inst "$moddir/dhclient.conf" "/etc/dhclient.conf" inst "$moddir/dhclient-script" "/sbin/dhclient-script" diff --git a/xCAT-nbroot2/nextdestiny b/xCAT-nbroot2/nextdestiny new file mode 100755 index 000000000..203b28f1a --- /dev/null +++ b/xCAT-nbroot2/nextdestiny @@ -0,0 +1,26 @@ +#!/bin/bash +if [ -z "$XCATDEST" ]; then + XCATDEST=$1 +fi +echo " +nextdestiny +300 +" > /tmp/destreq.xml +rm /tmp/destreq.xml +while [ ! -f /tmp/destreq.xml ] || grep error /tmp/ipmicfg.xml; do + if [ -f /tmp/destreq.xml ]; then + echo -n "Retrying in 60 seconds..."; + timer=60 + while [ $timer -gt 0 ]; do + sleep 1 + echo -n . + timer=$(($timer-1)); + done + fi + 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/ipmicfg.xml + else + cat /tmp/destreq.xml | openssl s_client -connect $XCATDEST -quiet 2> /dev/null > /tmp/ipmicfg.xml + fi +done +rm /tmp/destreq.xml