Redirect grep out to null
Add debug message to validate_host
This commit is contained in:
parent
8736baabbe
commit
7ae3792fbc
|
@ -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 $?
|
||||
|
|
Loading…
Reference in New Issue