From 0cd215f962c4e81f7846b2eb329bad275d96e4d4 Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 8 May 2023 19:43:31 +0200 Subject: [PATCH] Check IP/Port --- run/check.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/run/check.sh b/run/check.sh index 8cfc61b..5ffab1f 100644 --- a/run/check.sh +++ b/run/check.sh @@ -21,6 +21,11 @@ rest=${rest#*:} rest=${rest%%,*} PORT=${rest%%\"*} +if [ -z "${PORT}" ]; then + echo "Guest has not set a portnumber yet.." + exit 1 +fi + # Retrieve the IP address if [[ ! "${RESPONSE}" =~ "eth0" ]] ; then @@ -34,6 +39,11 @@ rest=${rest#*:} rest=${rest#*\"} IP=${rest%%\"*} +if [ -z "${IP}" ]; then + echo "Guest has not received an IP yet.." + exit 1 +fi + if ! curl -m 3 -ILfSs "http://${IP}:${PORT}/" > /dev/null; then echo "Failed to reach ${IP}:${PORT}" exit 1