summaryrefslogtreecommitdiffstats
path: root/etc/inc/pfsense-utils.inc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2015-01-27 11:57:11 -0200
committerRenato Botelho <garga@FreeBSD.org>2015-01-27 11:57:11 -0200
commit4f009171d55096b05a9c968383bdcab7dd12a92b (patch)
tree02895e5144289d40650266352523bc90099981f5 /etc/inc/pfsense-utils.inc
parent873cab1610c1fa8ef426476b03a22ec1ed806373 (diff)
downloadpfsense-4f009171d55096b05a9c968383bdcab7dd12a92b.zip
pfsense-4f009171d55096b05a9c968383bdcab7dd12a92b.tar.gz
Simplify use of other serial ports setting all of them as onifconsole when serial is enabled
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r--etc/inc/pfsense-utils.inc9
1 files changed, 5 insertions, 4 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 6fbb20c..9bc94cd 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1019,7 +1019,7 @@ function setup_serial_port($when="save", $path="") {
$ttys_split = explode("\n", $ttys);
$fd = fopen($ttys_file, "w");
- $on_off = (is_serial_enabled() ? 'on' : 'off');
+ $on_off = (is_serial_enabled() ? 'onifconsole' : 'off');
if (isset($config['system']['disableconsolemenu'])) {
$console_type = 'Pc';
@@ -1031,9 +1031,10 @@ function setup_serial_port($when="save", $path="") {
foreach($ttys_split as $tty) {
if (stristr($tty, "ttyv0"))
fwrite($fd, "ttyv0 \"/usr/libexec/getty {$console_type}\" cons25 on secure\n");
- else if (stristr($tty, "ttyu0"))
- fwrite($fd, "ttyu0 \"/usr/libexec/getty {$serial_type}\" cons25 {$on_off} secure\n");
- else
+ else if (stristr($tty, "ttyu")) {
+ $ttyn = substr($tty, 0, 5);
+ fwrite($fd, "{$ttyn} \"/usr/libexec/getty {$serial_type}\" cons25 {$on_off} secure\n");
+ } else
fwrite($fd, $tty . "\n");
}
unset($on_off, $console_type, $serial_type);
OpenPOWER on IntegriCloud