#ipmitool -H ${TARGET_HOST}-ipmi -f /etc/jenkins/$TARGET_HOST.ipmi -U ADMIN -I lanplus sol activate < /dev/zero | tee $TMPOUTPUT &
set +x
+never_pinged=true
#
# check for 15min whether ssh comes back
#
for i in $(seq 1 90) ; do
sleep 2
if $(ping -c 1 $TARGET_HOST >/dev/null) ; then
+ never_pinged=false
sleep 8 # if it doesnt ping the timeout is 10secs anyway...
echo -n "ping $TARGET_HOST ok..."
# check ssh
fi
else
echo "$TARGET_HOST does not ping at $(date +%H:%M:%S)"
+ #
+ # sometimes a host doesnt boot correctly...
+ #
+ if $never_pinged && [ $i -gt -5 ] ; then
+ figlet problem
+ echo "Host doesn't come up, probably booted with the wrong ethernet device as $TARGET_DEV"
+ echo "Rebooting and retrying..."
+ echo
+ $0 $@ &
+ exit 0
+ fi
fi
done
if ! $(nc -z $TARGET_HOST 22 ) ; then