summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-10-21 22:03:07 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-10-21 22:03:07 +0000
commit82184ab0835bb5fa189e118b9aacb121b2dc483d (patch)
tree1d75048e409f4d4020c8e236c62b18ab5359c4e2 /usr
parent6aadbe0ab65315dbd7ca4e8b47a7d789693c308c (diff)
downloadpfsense-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-xusr/local/www/system_advanced.php33
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();
+
}
}
OpenPOWER on IntegriCloud