diff --git a/slapos/recipe/check_url_available/template/check_url.in b/slapos/recipe/check_url_available/template/check_url.in index 4a2185b37130e3a2be2ac2a5830a8b7f1b60e339..2e1da8b8938b2cf8c79113ce6921591d22548cf7 100644 --- a/slapos/recipe/check_url_available/template/check_url.in +++ b/slapos/recipe/check_url_available/template/check_url.in @@ -9,7 +9,17 @@ if [ -z $URL ]; then exit 3 fi -CODE=$(%(curl_path)s -k -sL $URL -w %%{http_code} -o /dev/null) +CODE=$(%(curl_path)s -g -k -sL $URL -w %%{http_code} -o /dev/null) + +if [ $? -eq 3 ]; then + echo "URL malformed: $URL." >&2 + exit 1 +fi + +if [ $? -eq 7 ]; then + echo "Failed to connect to host: $URL." >&2 + exit 1 +fi if [ ! $CODE ]; then echo "$URL is not available (server not reachable)." >&2