mirror of
https://github.com/unraid/webgui.git
synced 2026-02-17 22:48:53 -06:00
Fix PHP errors
This commit is contained in:
@@ -24,7 +24,7 @@ function port($eth) {
|
||||
$sys = "/sys/class/net";
|
||||
if (substr($eth,0,4)=='wlan') return $eth;
|
||||
$x = preg_replace('/[^0-9]/','',$eth);
|
||||
return file_exists("$sys/br{$x}") ? "br${x}" : (file_exists("$sys/bond{$x}") ? "bond{$x}" : "eth{$x}");
|
||||
return file_exists("$sys/br{$x}") ? "br{$x}" : (file_exists("$sys/bond{$x}") ? "bond{$x}" : "eth{$x}");
|
||||
}
|
||||
|
||||
exec("grep -Po 'nameserver \K\S+' /etc/resolv.conf 2>/dev/null",$ns);
|
||||
|
||||
@@ -270,6 +270,6 @@ function check_network_connectivity(): bool {
|
||||
function lan_port($port, $state=false) {
|
||||
$system = '/sys/class/net';
|
||||
$exist = file_exists("$system/$port");
|
||||
return !$state ? $exist : ($exist ? file_get_contents("$system/$port/carrier") : false);
|
||||
return !$state ? $exist : ($exist ? (@file_get_contents("$system/$port/carrier") ?: 0) : false);
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user