diff options
author | doktornotor <notordoktor@gmail.com> | 2017-03-10 03:37:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-10 03:37:16 +0100 |
commit | 2e4f5048f1655e7e8abd928cbd5b0f4edecad1f3 (patch) | |
tree | fb4ebe76617b5c210bc85a265ebaf15dddf36642 /src | |
parent | 2b359eda6d4d6712888a59cb5b01aeee245e34be (diff) | |
download | pfsense-2e4f5048f1655e7e8abd928cbd5b0f4edecad1f3.zip pfsense-2e4f5048f1655e7e8abd928cbd5b0f4edecad1f3.tar.gz |
Do not report misleading 3G service status (Bug #4287)
If the ^SIMST or ^SRVST info was never received from the device, report missing/unknown states instead.
Diffstat (limited to 'src')
-rwxr-xr-x | src/usr/local/bin/3gstats.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/usr/local/bin/3gstats.php b/src/usr/local/bin/3gstats.php index b192865..28c3f31 100755 --- a/src/usr/local/bin/3gstats.php +++ b/src/usr/local/bin/3gstats.php @@ -22,7 +22,7 @@ ini_set("max_execution_time", "0"); -if(empty($argv[1])) { +if (empty($argv[1])) { echo "No modem device given \n"; exit(0); } @@ -37,7 +37,7 @@ $i = 0; $record = array(); $handle = fopen($device, "r"); -if(! $handle) { +if (!$handle) { echo "Can not open modem stats device\n"; exit(1); } @@ -51,8 +51,8 @@ $record['sent'] = 0; $record['received'] = 0; $record['bwupstream'] = 0; $record['bwdownstream'] = 0; -$record['simstate'] = 0; -$record['service'] = 0; +$record['simstate'] = 255; +$record['service'] = 255; while (true) { $string = ""; |