sleep 3
if $(ping -c 1 $TESTSERVER >/dev/null) ; then
figlet "Warning:"
- echo "$TESTSERVER responds to pings, even though it was reseted 3secs ago, this should not happen, please investigate manually."
+ echo "$TESTSERVER responds to pings, even though it was reset 3secs ago, this should not happen, please investigate manually."
exit 1
fi
#
-# check for 10min whether it's up again
+# check for 10min whether it's booting up again
#
echo "Pinging $TESTSERVER..."
for i in $(seq 1 60) ; do
sleep 10
echo "."
if $(ping -c 1 $TESTSERVER >/dev/null) ; then
- echo "$TESTSERVER pings again, so we assume it's up."
+ echo "$TESTSERVER pings again, so we assume it's booting now."
break
fi
done
exit 1
fi
+#
+# check for 15min whether ssh comes back
+#
+echo "Checking for sshd running on $TESTSERVER..."
+for i in $(seq 1 90) ; do
+ sleep 10
+ if $(ping -c 1 $TESTSERVER >/dev/null) ; then
+ echo -n "ping $TESTSERVER ok..."
+ # check ssh FIXME
+ if $(nc -z $TESTSERVER 22 ) ; then
+ echo "ok, sshd is running."
+ break
+ else
+ echo "but sshd is not running."
+ fi
+ fi
+done
+if ! $(nc -z $TESTSERVER 22 ) ; then
+ figlet "Failure:"
+ echo "$TESTSERVER still not running sshd, please investigate."
+ exit 1
+fi
+
#
# send announce mail
#
echo "$MAIL does not exist, something wrong with liveboot-web?"
exit 1
fi
-cat $MAIL | /usr/sbin/sendmail $MAILTO && echo "Ok, mail to $MAILTO send."
+cat $MAIL
+cat $MAIL | /usr/sbin/sendmail $MAILTO
+echo
+echo "Ok, mail to $MAILTO send."
#
# finish