diff --git a/scheduling-abstraction-layer/src/main/resources/prepare_infra_script.sh b/scheduling-abstraction-layer/src/main/resources/prepare_infra_script.sh index fa1ef6528c700f96c805fdbf247e89b702435b68..7dae2c4a0c8a31ccec8938143aea7e004f4afa91 100644 --- a/scheduling-abstraction-layer/src/main/resources/prepare_infra_script.sh +++ b/scheduling-abstraction-layer/src/main/resources/prepare_infra_script.sh @@ -1,8 +1,20 @@ PROVIDED_PORT_NAME=$variables_providedPortName if [[ ! -z $PROVIDED_PORT_NAME ]]; then - IP_ADDR=$(dig +short myip.opendns.com @resolver1.opendns.com) - echo Public adress: $IP_ADDR + + wget -q https://raw.githubusercontent.com/ow2-proactive/utility-scripts/main/network-scripts/Get_public_ip.sh && chmod +x Get_public_ip.sh || { echo "failed to download the IP script"; exit 1; } + IP_ADDR=`./Get_public_ip.sh` + CODE=$? + echo "The Public IP was retreived with code: $CODE" + + if [[ $CODE -lt 6 ]] + then + echo Public adress: $IP_ADDR + else + echo "Getting the Public IP failed!" + echo "The recieved IP: $IP_ADDR" + exit 1 + fi echo "$IP_ADDR" > $PROVIDED_PORT_NAME"_ip" fi \ No newline at end of file