From 284101d3b826bf399146fabe7c95eff02b2070f2 Mon Sep 17 00:00:00 2001 From: smos Date: Sat, 2 Jun 2012 16:10:14 +0200 Subject: Add support for the ZTE modem stats Should be generic enough for other modems too. --- etc/inc/interfaces.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'etc') diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 147ad1d..b591917 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1736,13 +1736,17 @@ EOD; /* We can also guess the mondev from the manufacturer */ exec("usbconfig | egrep -ie '(huawei)'", $usbmodemoutput); mwexec("/bin/ps auxww|grep \"{$interface}\" |grep \"[3]gstats\" | awk '{print $2}' |xargs kill"); - if(stristr("huawei", implode("\n", $ouput))) { - foreach($ports as $port) { + foreach($ports as $port) { + if(stristr("huawei", implode("\n", $ouput))) { $mondev = substr(basename($port), 0, -1); $devlist = glob("/dev/{$mondev}?"); $mondev = basename(end($devlist)); - log_error("Starting 3gstats.php on device '{$mondev}' for interface '{$interface}'"); - mwexec_bg("/usr/local/bin/3gstats.php {$mondev} {$interface}"); + } + if(stristr("zte", implode("\n", $ouput))) { + $mondev = substr(basename($port), 0, -1) . "1"; + } + log_error("Starting 3gstats.php on device '{$mondev}' for interface '{$interface}'"); + mwexec_bg("/usr/local/bin/3gstats.php {$mondev} {$interface}"); } } -- cgit v1.1