diff --git a/scripts/cnode-helper-scripts/cntools.sh b/scripts/cnode-helper-scripts/cntools.sh index 9053f69c4..f975c04c8 100755 --- a/scripts/cnode-helper-scripts/cntools.sh +++ b/scripts/cnode-helper-scripts/cntools.sh @@ -2202,7 +2202,7 @@ function main { if [[ -n "${relay_port_enter}" ]]; then if ! isNumber ${relay_port_enter} || [[ ${relay_port_enter} -lt 1 || ${relay_port_enter} -gt 65535 ]]; then println ERROR "${FG_RED}ERROR${NC}: invalid port number!" - elif isValidIPv4 "${relay_ip_enter}" && ! isValidHostnameOrDomain "${relay_ip_enter}"; then + elif isValidIPv4 "${relay_ip_enter}" || isValidHostnameOrDomain "${relay_ip_enter}"; then relay_array+=( "type" "IPv4" "address" "${relay_ip_enter}" "port" "${relay_port_enter}" ) relay_output+="--pool-relay-port ${relay_port_enter} --pool-relay-ipv4 ${relay_ip_enter} " else diff --git a/scripts/cnode-helper-scripts/topologyUpdater.sh b/scripts/cnode-helper-scripts/topologyUpdater.sh index 52e2b105e..91340ac72 100755 --- a/scripts/cnode-helper-scripts/topologyUpdater.sh +++ b/scripts/cnode-helper-scripts/topologyUpdater.sh @@ -155,8 +155,9 @@ if [[ ${TU_FETCH} = "Y" ]]; then *) echo "ERROR: Invalid Custom Peer definition '${cpeer}'. Please double check CUSTOM_PEERS definition" exit 1 ;; esac - if [[ ${addr} = *.* ]]; then - ! isValidIPv4 "${addr}" && echo "ERROR: Invalid IPv4 address or hostname '${addr}'. Please check CUSTOM_PEERS definition" && continue + if ! isValidIPv4 "${addr}" && ! isValidHostnameOrDomain "${addr}"; then + echo "ERROR: Invalid IPv4 address or hostname '${addr}'. Please check CUSTOM_PEERS definition" + continue elif [[ ${addr} = *:* ]]; then ! isValidIPv6 "${addr}" && echo "ERROR: Invalid IPv6 address '${addr}'. Please check CUSTOM_PEERS definition" && continue fi