summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-02-19 03:03:20 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-02-19 03:03:20 +0000
commitdc6f894212ac939b8f570c3fe61bc4ff53926da3 (patch)
treef14e1c31e7bec0326bc0ddd96ad559605c6442bc /etc
parent2d064820ef6db1b6be5af0f464eefacbd1fdee14 (diff)
downloadpfsense-dc6f894212ac939b8f570c3fe61bc4ff53926da3.zip
pfsense-dc6f894212ac939b8f570c3fe61bc4ff53926da3.tar.gz
Correctly unset interface and do not define <if> later blindly.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/config.inc13
1 files changed, 8 insertions, 5 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 002d4d3..9822f86 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -1490,8 +1490,7 @@ EOD;
if($lanif == "") {
if($g['minimum_nic_count'] < 2) {
- unset($config['interfaces']['lan']);
- write_config();
+ unset($config['interfaces']['lan']);
break;
} else {
fclose($fp);
@@ -1576,8 +1575,10 @@ Do you want to proceed [y|n]?
EOD;
if (strcasecmp(chop(fgets($fp)), "y") == 0) {
-
- $config['interfaces']['lan']['if'] = $lanif;
+ if($lanif)
+ $config['interfaces']['lan']['if'] = $lanif;
+ else
+ unset($config['interfaces']['lan']['if']);
if (preg_match($g['wireless_regex'], $lanif)) {
if (!is_array($config['interfaces']['lan']['wireless']))
$config['interfaces']['lan']['wireless'] = array();
@@ -1615,7 +1616,9 @@ EOD;
for (; isset($config['interfaces']['opt' . ($i+1)]); $i++)
unset($config['interfaces']['opt' . ($i+1)]);
+ echo "Writing configuration...";
write_config();
+ echo "done.\n";
echo <<<EOD
@@ -2006,4 +2009,4 @@ function set_device_perms() {
if($g['booting']) echo ".";
$config = parse_config();
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud