diff options
author | Phil Davis <phil.davis@inf.org> | 2015-07-14 19:09:01 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-07-14 19:09:01 +0545 |
commit | cc4d13683e50595abc14efc43c91a087f123a979 (patch) | |
tree | 3b249a8ede1f23684b6c53ccdc3b8eac05e80d87 /usr/local/www/interfaces_ppps_edit.php | |
parent | 82921c72fa346730140aeb774ad56908f1df8f5c (diff) | |
download | pfsense-cc4d13683e50595abc14efc43c91a087f123a979.zip pfsense-cc4d13683e50595abc14efc43c91a087f123a979.tar.gz |
Fix glob for serial device names
Removing the "." that was in {,.[0-9]} allows it to match /dev/cuau10 and onward.
I added lots of comments on the glob expression, because the format of the glob expression is not the same as an ordinary regex.
Diffstat (limited to 'usr/local/www/interfaces_ppps_edit.php')
-rw-r--r-- | usr/local/www/interfaces_ppps_edit.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php index 035f915..89397f5 100644 --- a/usr/local/www/interfaces_ppps_edit.php +++ b/usr/local/www/interfaces_ppps_edit.php @@ -484,7 +484,12 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE" mwexec("/bin/mkdir -p /var/spool/lock"); } // $serialports = pfSense_get_modem_devices(); - $serialports = glob("/dev/cua?[0-9]{,.[0-9]}", GLOB_BRACE); + // Match files in /dev starting with "cua" then: + // ? = any single character e.g. like "cuau" + // [0-9] = a digit from 0 to 9 + // {,[0-9]} = nothing (the empty before the comma) or a digit from 0 to 9 + // This supports up to 100 devices (0 to 99), e.g. cuau0 cuau1 ... cuau10 cuau11 ... cuau99 + $serialports = glob("/dev/cua?[0-9]{,[0-9]}", GLOB_BRACE); $serport_count = 0; foreach ($serialports as $port) { $serport_count++; |