diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-10-21 22:03:07 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-10-21 22:03:07 +0000 |
commit | 82184ab0835bb5fa189e118b9aacb121b2dc483d (patch) | |
tree | 1d75048e409f4d4020c8e236c62b18ab5359c4e2 /usr | |
parent | 6aadbe0ab65315dbd7ca4e8b47a7d789693c308c (diff) | |
download | pfsense-82184ab0835bb5fa189e118b9aacb121b2dc483d.zip pfsense-82184ab0835bb5fa189e118b9aacb121b2dc483d.tar.gz |
MFC 7033
Enable and disable serial console support if requested. Recent changes for USB keyboard and vty's changed this behavior some.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/system_advanced.php | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/usr/local/www/system_advanced.php b/usr/local/www/system_advanced.php index 5b7e2d8..20afb34 100755 --- a/usr/local/www/system_advanced.php +++ b/usr/local/www/system_advanced.php @@ -211,28 +211,33 @@ if ($_POST) { $savemsg = $retval; $retval |= interfaces_optional_configure(); config_unlock(); - - $etc_ttys = return_filename_as_array("/etc/ttys"); - + + /* serial console */ + if(file_exists("/boot.config")) + $boot_config = file_get_contents("/boot.config"); + else + $boot_config = ""; + + $boot_config_split = split("\n", $boot_config); conf_mount_rw(); - $fout = fopen("/etc/ttys","w"); - if(!$fout) { - echo "Cannot open /etc/ttys for writing. Floppy inserted?\n"; - } else { - foreach($etc_ttys as $tty) { - if(stristr($tty,"ttyv0") <> true) { - if($tty <> "") - fwrite($fout, $tty . "\n"); + $fd = fopen("/boot.config","w"); + if($fd) { + foreach($boot_config_split as $bcs) { + if(stristr($bcs, "-D")) { + if(isset($config['system']['enableserial'])) { + fwrite($fd, "-D"); + } + } else { + fwrite($fd, "{$bcs}\n"); } } - if(isset($pconfig['enableserial'])) - fwrite($fout, "ttyv0\t\"/usr/libexec/getty Pc\"\tcons25\t\ton\tsecure\n"); - fclose($fout); + fclose($fd); } conf_mount_ro(); + } } |