diff --git a/index.php b/index.php index 2d4ac18..aab8925 100644 --- a/index.php +++ b/index.php @@ -50,9 +50,9 @@ function GetIP(string $type) if (strpos($ip, '.')) break; } } else if ('ipv6' == $type) - $ip = trim(`curl --silent -6 icanhazip.com`); + $ip = trim(`dig @resolver1.ipv6-sandbox.opendns.com AAAA myip.opendns.com +short -6`); else if ('ipv4' == $type) - $ip = trim(`curl --silent -4 icanhazip.com`); + $ip = trim(`dig @resolver4.opendns.com myip.opendns.com +short -4`); else $ip = ''; return $ip; @@ -186,11 +186,16 @@ foreach($showlist as $section) { echo '
', "\n"; break; case 'IP': + $hasv6 = str_contains(GetCFGValue('ircddb0_host'), 'v6'); + if (! $hasv6) $hasv6 = str_contains(GetCFGValue('ircddb1_host'), 'v6'); echo 'IP Addresses:
', "\n"; echo '', "\n"; - echo '', "\n"; - echo '', "\n"; - echo '
InternalIPV4IPV6
', GetIP('internal'), '', GetIP('ipv4'), '', GetIP('ipv6'), '

', "\n"; + echo 'InternalIPV4'; + if ($hasv6) echo 'IPV6'; + echo "\n"; + echo '', GetIP('internal'), '', GetIP('ipv4'), ''; + if ($hasv6) echo '', GetIP('ipv6'), ''; + echo "\n", '
', "\n"; break; case 'MO': echo 'Modules:
', "\n"; @@ -272,6 +277,6 @@ foreach($showlist as $section) { } ?>
-

QnetGateway Dashboard Version 613 Copyright © by Thomas A. Early, N7TAE.

+

QnetGateway Dashboard Version 10208 Copyright © by Thomas A. Early, N7TAE.