diff options
author | Ermal <eri@pfsense.org> | 2010-12-23 20:06:24 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-12-23 20:06:24 +0000 |
commit | e503c44a755a52648da77585517ced6d506258e6 (patch) | |
tree | cef0eeaef5cd651132a4dfd2b6dd5f26d48df91e | |
parent | c6c26178a55f360863447d1db98fb0ffa385e8cb (diff) | |
download | pfsense-e503c44a755a52648da77585517ced6d506258e6.zip pfsense-e503c44a755a52648da77585517ced6d506258e6.tar.gz |
Add some more safe belts and remove code that is commented from long time now. Reported on http://forum.pfsense.org/index.php/topic,28202.15.html
-rw-r--r-- | etc/inc/config.console.inc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/etc/inc/config.console.inc b/etc/inc/config.console.inc index 1514926..9005b79 100644 --- a/etc/inc/config.console.inc +++ b/etc/inc/config.console.inc @@ -319,6 +319,8 @@ EOD; if (in_array($key, array('y', 'Y'))) { if($lanif) { + if (!is_array($config['interfaces']['lan'])) + $config['interfaces']['lan'] = array(); $config['interfaces']['lan']['if'] = $lanif; $config['interfaces']['lan']['enable'] = true; } elseif (!$g['booting'] && !$auto_assign) { @@ -332,7 +334,7 @@ unload the interface now? [y|n]? EODD; if (strcasecmp(chop(fgets($fp)), "y") == 0) { - if($config['interfaces']['lan']['if']) + if(isset($config['interfaces']['lan']) && $config['interfaces']['lan']['if']) mwexec("/sbin/ifconfig " . $config['interfaces']['lan']['if'] . " delete"); } if(isset($config['interfaces']['lan'])) @@ -372,9 +374,12 @@ EODD; (!is_array($config['interfaces']['lan']['wireless']))) $config['interfaces']['lan']['wireless'] = array(); } else { - unset($config['interfaces']['lan']['wireless']); + if (isset($config['interfaces']['lan'])) + unset($config['interfaces']['lan']['wireless']); } + if (!is_array($config['interfaces']['wan'])) + $config['interfaces']['wan'] = array(); $config['interfaces']['wan']['if'] = $wanif; $config['interfaces']['wan']['enable'] = true; if (preg_match($g['wireless_regex'], $wanif)) { @@ -382,7 +387,8 @@ EODD; (!is_array($config['interfaces']['wan']['wireless']))) $config['interfaces']['wan']['wireless'] = array(); } else { - unset($config['interfaces']['wan']['wireless']); + if (isset($config['interfaces']['wan'])) + unset($config['interfaces']['wan']['wireless']); } for ($i = 0; $i < count($optif); $i++) { @@ -420,12 +426,6 @@ EODD; $g['booting'] = false; - /* XXX: ermal - disable it for now this is used during bootup at best so shouldn't be needed. - * For now just comment it out and later remove it completely. - * resync everything - reload_all_sync(); - */ - echo " done!\n"; touch("{$g['tmp_path']}/assign_complete"); @@ -535,4 +535,4 @@ EOD; } } -?>
\ No newline at end of file +?> |