From 34eca22b82ba6d578fbbd1133543b2cdbbd2155c Mon Sep 17 00:00:00 2001 From: bergware Date: Fri, 25 Jun 2021 15:46:31 +0200 Subject: [PATCH] Nchan implementation --- plugins/dynamix/nchan/update_3 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/dynamix/nchan/update_3 b/plugins/dynamix/nchan/update_3 index cabcc2787..c61aef8c5 100755 --- a/plugins/dynamix/nchan/update_3 +++ b/plugins/dynamix/nchan/update_3 @@ -19,21 +19,21 @@ $data = []; require_once "$docroot/webGui/include/Helpers.php"; require_once "$docroot/webGui/include/publish.php"; -exec("ls $net|grep -Po '^(lo|(bond|eth)\d+)$'",$ports); - // satisfy translations (not used) if (!function_exists('_')) { function _($text) {return $text;} } $time0 = $time = microtime(true); +exec("ls $net|grep -Po '^(lo|(bond|eth)\d+)$'",$ports); foreach ($ports as $port) { $data[$port]['rx'] = (float)file_get_contents("$net/$port/statistics/rx_bytes"); $data[$port]['tx'] = (float)file_get_contents("$net/$port/statistics/tx_bytes"); } while (true) { - $echo = $mode = $rxtx = $stat = []; + $ports = $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");