diff options
author | nachoparker <nacho@ownyourbits.com> | 2021-10-15 18:02:41 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2021-10-18 20:24:01 +0300 |
commit | 326de1d0856864c207d72c0c591b77d81b1da36e (patch) | |
tree | 40a269fc8cb4843c98c14c80890b8cd5a7f9cdcd | |
parent | d12b30c7ebb865f5ee5f2a295167f535b8cbef05 (diff) |
fix dual IPv6 stack port checkingv1.41.8
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rw-r--r-- | bin/ncp-diag | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/ncp-diag b/bin/ncp-diag index d8780499..7f2a49bf 100644 --- a/bin/ncp-diag +++ b/bin/ncp-diag @@ -70,6 +70,9 @@ function is_port_open() local port=$1 local public_ip public_ip="$(curl -m4 -4 https://icanhazip.com 2>/dev/null)" || { echo "closed"; return 1; } + if [[ "${public_ip}" == "" ]]; then + public_ip="$(curl -m4 -6 https://icanhazip.com 2>/dev/null)" || { echo "closed"; return 1; } + fi local tmp_file=$(mktemp) local token=$(wget -T2 -t1 -qO- --keep-session-cookies --save-cookies $tmp_file https://portchecker.co | grep -oP "_csrf\" value=\"\K.*\"") |