diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-08-02 23:50:31 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-08-02 23:50:31 +0000 |
commit | 9c853fb551e0a3b2a18bace16f610714730d3e28 (patch) | |
tree | dfae339e641736578709c4a77f7980d702176971 /usr | |
parent | dc1ba275acf1d329553f92db7d0ca0d63f5afa7f (diff) | |
download | pfsense-9c853fb551e0a3b2a18bace16f610714730d3e28.zip pfsense-9c853fb551e0a3b2a18bace16f610714730d3e28.tar.gz |
Alert to user that we cannot open a file for writing instead of letting php spew bad looking errors.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/system_advanced.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr/local/www/system_advanced.php b/usr/local/www/system_advanced.php index a24778d..b4d7145 100755 --- a/usr/local/www/system_advanced.php +++ b/usr/local/www/system_advanced.php @@ -187,14 +187,18 @@ if ($_POST) { conf_mount_rw(); $fout = fopen("/etc/ttys","w"); - foreach($etc_ttys as $tty) { - if(stristr($tty,"ttyv0") <> true) { - fwrite($fout, $tty . "\n"); + if(!$fout) { + echo "Cannot open /etc/ttys for writing. Floppy inserted?\n"; + } else { + foreach($etc_ttys as $tty) { + if(stristr($tty,"ttyv0") <> true) { + fwrite($fout, $tty . "\n"); + } } + if(isset($pconfig['enableserial'])) + fwrite($fout, "ttyv0\t\"/usr/libexec/getty Pc\"\tcons25\t\ton\tsecure\n"); + fclose($fout); } - if(isset($pconfig['enableserial'])) - fwrite($fout, "ttyv0\t\"/usr/libexec/getty Pc\"\tcons25\t\ton\tsecure\n"); - fclose($fout); $fout = fopen("/boot/loader.rc","w"); if(!is_array($boot_loader_rc)) |