diff options
author | smos <seth.mos@dds.nl> | 2012-06-05 21:01:56 +0200 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2012-06-05 21:39:34 +0200 |
commit | 7056e4edbfb1553cf5761c269499c95dfa1ea344 (patch) | |
tree | da1625abeda056e05daf6e4621b1ff293a72e713 /etc/inc/interfaces.inc | |
parent | 8574d3516c54971c7d5839046982cd988cfc31ae (diff) | |
download | pfsense-7056e4edbfb1553cf5761c269499c95dfa1ea344.zip pfsense-7056e4edbfb1553cf5761c269499c95dfa1ea344.tar.gz |
Use preg_match instead, we should probably make this a function so we can add proper device detection schemes and a known list of command ports.
That would also allow for resetting the 3g stick when it hangs.
We should consider storing the device and manufacturer in the ppp config
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r-- | etc/inc/interfaces.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index cae3b3a..78b3067 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1738,12 +1738,12 @@ EOD; exec("usbconfig | egrep -ie '(huawei)'", $usbmodemoutput); mwexec("/bin/ps auxww|grep \"{$interface}\" |grep \"[3]gstats\" | awk '{print $2}' |xargs kill"); foreach($ports as $port) { - if(stristr("huawei", implode("\n", $usbmodemoutput))) { + if(preg_match("/huawei/i", implode("\n", $usbmodemoutput))) { $mondev = substr(basename($port), 0, -1); $devlist = glob("/dev/{$mondev}?"); $mondev = basename(end($devlist)); } - if(stristr("zte", implode("\n", $usbmodemoutput))) { + if(preg_match("/zte/i", implode("\n", $usbmodemoutput))) { $mondev = substr(basename($port), 0, -1) . "1"; } log_error("Starting 3gstats.php on device '{$mondev}' for interface '{$interface}'"); |