mirror of
https://github.com/unraid/webgui.git
synced 2026-01-04 00:19:57 -06:00
Update NetworkInfo.php
This commit is contained in:
@@ -31,13 +31,13 @@ $error = "<span class='red-text'>"._('Missing')."</span>";
|
||||
$note = $eth=='eth0' && !$vlan ? $error : $none;
|
||||
$link = _(ucfirst(exec("ethtool $eth | awk '$1==\"Link\" {print $3;exit}'")))." (".exec("ethtool $eth | grep -Pom1 '^\s+Port: \K.*'").")";
|
||||
$speed = _(preg_replace(['/^(\d+)/','/!/'],['$1 ',''],exec("ethtool $eth | awk '$1==\"Speed:\" {print $2;exit}'")));
|
||||
$ipv4 = explode(' ',exec("ip -4 -br addr show scope global $port | awk '{\$1=\$2=\"\";print;exit}' | sed -r 's/ metric [0-9]+//g; s/\/[0-9]+//g' | xargs"));
|
||||
$ipv4 = array_filter(explode(' ',exec("ip -4 -br addr show scope global $port | awk '{\$1=\$2=\"\";print;exit}' | sed -r 's/ metric [0-9]+//g; s/\/[0-9]+//g'")));
|
||||
$gw4 = exec("ip -4 route show default dev $port | awk '{print \$3;exit}'") ?: $note;
|
||||
$dns4 = array_filter($ns,function($ns){return strpos($ns,':')===false;});
|
||||
$domain = exec("grep -Pom1 'domain \K.*' /etc/resolv.conf") ?: '---';
|
||||
|
||||
if ($v6on) {
|
||||
$ipv6 = explode(' ',exec("ip -6 -br addr show scope global $port | awk '{\$1=\$2=\"\";print;exit}' | sed -r 's/ metric [0-9]+//g; s/\/[0-9]+//g' | xargs"));
|
||||
$ipv6 = array_filter(explode(' ',exec("ip -6 -br addr show scope global $port | awk '{\$1=\$2=\"\";print;exit}' | sed -r 's/ metric [0-9]+//g; s/\/[0-9]+//g'")));
|
||||
$gw6 = exec("ip -6 route show default dev $port | awk '{print \$3;exit}'") ?: $note;
|
||||
$dns6 = array_filter($ns,function($ns){return strpos($ns,':')!==false;});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user