Redirect grep out to null

Add debug message to validate_host
This commit is contained in:
Lutchy Horace 2021-02-17 11:39:42 -05:00
parent 8736baabbe
commit 7ae3792fbc
1 changed files with 2 additions and 1 deletions

View File

@ -26,8 +26,9 @@ function warn
function validate_host 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 if [ $? -eq 0 ]; then
debug "Checking host is resolvable: $1"
curl $1 > /dev/null 2>&1 curl $1 > /dev/null 2>&1
fi fi
return $? return $?