Initial support for --donotredirect
This commit is contained in:
parent
185d813c0e
commit
2a08de6115
2 changed files with 63 additions and 17 deletions
11
bootstrap.sh
11
bootstrap.sh
|
|
@ -26,13 +26,18 @@ function warn
|
|||
|
||||
function validate_host
|
||||
{
|
||||
local _ret=0
|
||||
|
||||
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"
|
||||
# The remote servers may sometimes have self-signed certs
|
||||
curl --insecure $1 > /dev/null 2>&1
|
||||
# Add --insecure becase remote servers may sometimes have self-signed certs
|
||||
if ! curl --insecure $1 > /dev/null 2>&1; then
|
||||
_ret=1
|
||||
debug "Host '$1' is not resolvable!"
|
||||
fi
|
||||
fi
|
||||
return $?
|
||||
return $_ret
|
||||
}
|
||||
|
||||
function validate_ip
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue