From 7ae3792fbcbf0affba0f659edc6f98410702cf07 Mon Sep 17 00:00:00 2001 From: Lutchy Horace Date: Wed, 17 Feb 2021 11:39:42 -0500 Subject: [PATCH] Redirect grep out to null Add debug message to validate_host --- bootstrap.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 4ef550d..be180b5 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -26,8 +26,9 @@ function warn function validate_host { - echo "$1" | grep -P '^(http|https):\/\/(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])(:[0-9]+)?$' + echo "$1" | grep -P '^(http|https):\/\/(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])(:[0-9]+)?$' > /dev/null 2>&1 if [ $? -eq 0 ]; then + debug "Checking host is resolvable: $1" curl $1 > /dev/null 2>&1 fi return $?