diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-11-21 00:49:34 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-11-21 00:49:34 +0000 |
commit | 49ed889ceb922f3f83f72a0b262b51b1ef3efd67 (patch) | |
tree | b240351877ae93c86d8250c7a8b495d6394cf9c4 /etc/inc | |
parent | c9847bc40b98b7cd6c84b86fa8709c3ad8187d73 (diff) | |
download | pfsense-49ed889ceb922f3f83f72a0b262b51b1ef3efd67.zip pfsense-49ed889ceb922f3f83f72a0b262b51b1ef3efd67.tar.gz |
Eliminate Warning: file_get_contents(/cf/conf/config.xml): failed to open stream: No such file or directory in /etc/inc/config.inc on line 68 bug when assigning interfaces
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/config.inc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc index d6a5947..3a89658 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -64,15 +64,17 @@ if(file_exists("/debugging")) { $g['debug'] = true; } -$config_contents = file_get_contents("/cf/conf/config.xml"); -if(stristr($config_contents, "m0n0wall") == true) { - /* user has just upgraded to m0n0wall, replace root xml tags */ - echo "Upgrading m0n0wall configuration to pfSense... "; - $config_contents = str_replace("m0n0wall","pfsense"); - $fd = fopen("/cf/conf/config.xml", "w"); - fwrite($fd, $config_contents); - fclose($fd); - echo "done."; +if(file_exists("/cf/conf/config.xml")) { + $config_contents = file_get_contents("/cf/conf/config.xml"); + if(stristr($config_contents, "m0n0wall") == true) { + /* user has just upgraded to m0n0wall, replace root xml tags */ + echo "Upgrading m0n0wall configuration to pfSense... "; + $config_contents = str_replace("m0n0wall","pfsense"); + $fd = fopen("/cf/conf/config.xml", "w"); + fwrite($fd, $config_contents); + fclose($fd); + echo "done."; + } } /* if our config file exists bail out, we're already set. */ |