diff options
author | Renato Botelho <garga@FreeBSD.org> | 2015-01-27 11:57:11 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-01-27 12:22:36 -0200 |
commit | ca127ab7591dae588039c94baacea38b0d22d2e0 (patch) | |
tree | 869390b8cf8cd490a7b497bf2c840f22a01bebc8 | |
parent | 04c8360c7273c2e7ce78920b836f2c44183bc458 (diff) | |
download | pfsense-ca127ab7591dae588039c94baacea38b0d22d2e0.zip pfsense-ca127ab7591dae588039c94baacea38b0d22d2e0.tar.gz |
Simplify use of other serial ports setting all of them as onifconsole when serial is enabled
-rw-r--r-- | etc/inc/pfsense-utils.inc | 9 | ||||
-rw-r--r-- | etc/ttys | 8 |
2 files changed, 9 insertions, 8 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index ddd0991..7bf4108 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1021,7 +1021,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'; @@ -1033,9 +1033,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); @@ -41,9 +41,9 @@ ttyv7 "/usr/libexec/getty Pc" xterm off secure ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty al.115200" cons25 on secure -ttyu1 "/usr/libexec/getty std.9600" dialup off secure -ttyu2 "/usr/libexec/getty std.9600" dialup off secure -ttyu3 "/usr/libexec/getty std.9600" dialup off secure +ttyu0 "/usr/libexec/getty al.115200" cons25 onifconsole secure +ttyu1 "/usr/libexec/getty al.115200" cons25 onifconsole secure +ttyu2 "/usr/libexec/getty al.115200" cons25 onifconsole secure +ttyu3 "/usr/libexec/getty al.115200" cons25 onifconsole secure # Dumb console dcons "/usr/libexec/getty std.9600" vt100 off secure |