Nchan implementation

This commit is contained in:
bergware
2021-06-25 16:33:45 +02:00
parent 7014b1c646
commit 1c10e9aa55

View File

@@ -24,6 +24,7 @@ if (!function_exists('_')) {
function _($text) {return $text;}
}
function ports() {
global $net;
exec("ls $net|grep -Po '^(lo|(bond|eth)\d+)$'",$ports);
return $ports;
}
@@ -38,7 +39,6 @@ foreach (ports() as $port) {
while (true) {
$echo = $mode = $rxtx = $stat = [];
$ts = $time - $time0;
exec("ls $net|grep -Po '^(lo|(bond|eth)\d+)$'",$ports);
foreach (ports() as $port) {
// inbound + outbound speed
$rx = (float)file_get_contents("$net/$port/statistics/rx_bytes");