diff --git a/src/etc/inc/config.console.inc b/src/etc/inc/config.console.inc index 54b65ef71..492c4c0d7 100644 --- a/src/etc/inc/config.console.inc +++ b/src/etc/inc/config.console.inc @@ -39,19 +39,13 @@ function set_networking_interfaces_ports() $iflist = get_interface_list(); - /* Function flow is based on $key and $auto_assign or the lack thereof */ + /* Function flow is based on $key */ $key = null; - /* Only present auto interface option if running from LiveCD and interface mismatch*/ - if (is_install_media() && is_interface_mismatch()) { - $auto_assign = false; - } - echo << $ifa) { - if ($ifa['up']) - $plugged_in[] = $iface; - - } - - $lanif = array_shift($plugged_in); - $wanif = array_shift($plugged_in); - - if(isset($lanif) && !isset($wanif)) { - foreach ($iflist as $iface => $ifa) { - if ($iface != $lanif) { - $wanif = $iface; - break; - } - } - } - - echo << "") { - while (1) { - if ($optif[$i]) - $i++; - $io = $i + 1; + if($lanif <> "") { + while (1) { + if ($optif[$i]) + $i++; + $io = $i + 1; - if($config['interfaces']['opt' . $io]['descr']) - printf(gettext("%sOptional interface %s description found: %s"), "\n", $io, $config['interfaces']['opt' . $io]['descr']); + if($config['interfaces']['opt' . $io]['descr']) + printf(gettext("%sOptional interface %s description found: %s"), "\n", $io, $config['interfaces']['opt' . $io]['descr']); - printf(gettext("%sEnter the Optional %s interface name or 'a' for auto-detection%s" . - "(or nothing if finished):%s"), "\n", $io, "\n", " "); + printf(gettext("%sEnter the Optional %s interface name or 'a' for auto-detection%s" . + "(or nothing if finished):%s"), "\n", $io, "\n", " "); - $optif[$i] = chop(fgets($fp)); + $optif[$i] = chop(fgets($fp)); - if ($optif[$i]) { - if ($optif[$i] === "a") { - $ad = autodetect_interface(gettext("Optional") . " " . $io, $fp); - if ($ad) - $optif[$i] = $ad; - else - unset($optif[$i]); - } else if (!array_key_exists($optif[$i], $iflist)) { - printf(gettext("%sInvalid interface name '%s'%s"), "\n", $optif[$i], "\n"); + if ($optif[$i]) { + if ($optif[$i] === "a") { + $ad = autodetect_interface(gettext("Optional") . " " . $io, $fp); + if ($ad) + $optif[$i] = $ad; + else unset($optif[$i]); - continue; - } - } else { + } else if (!array_key_exists($optif[$i], $iflist)) { + printf(gettext("%sInvalid interface name '%s'%s"), "\n", $optif[$i], "\n"); unset($optif[$i]); - break; + continue; } + } else { + unset($optif[$i]); + break; } } @@ -286,7 +207,7 @@ EOD; $config['interfaces']['lan'] = array(); $config['interfaces']['lan']['if'] = $lanif; $config['interfaces']['lan']['enable'] = true; - } elseif (!file_exists("/var/run/booting") && !$auto_assign) { + } elseif (!file_exists("/var/run/booting")) { echo <<