# Check if exit code is 0 and returned value is not empty
[[$? -eq 0&& -n "${CODEX_NAT}"]]&&{echo"Public: Set CODEX_NAT: ${CODEX_NAT}"; break;}||{echo"Can't get Public IP - Retry in $SLEEP seconds / $((WAIT - SECONDS))";}
# Sleep and check again
sleep $SLEEP
done
fi
# Stop Codex run if can't get Public IP
[[ -z "${CODEX_NAT}"]]&&{echo"Can't get Public IP in $WAIT seconds - Stop Codex run";exit 1;}