Commit 6d3eded2 authored by Franco Fichtner's avatar Franco Fichtner

config: flush unused $auto_assign code

parent 81161cda
......@@ -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 <<<EOD
Valid interfaces are:
EOD;
if(!is_array($iflist)) {
......@@ -64,15 +58,6 @@ EOD;
}
}
if ($auto_assign) {
echo <<<EOD
!!! LiveCD Detected: Auto Interface Option !!!!
BEGIN MANUAL CONFIGURATION OR WE WILL PROCEED WITH AUTO CONFIGURATION.
EOD;
}
echo <<<EOD
Do you want to set up VLANs first?
......@@ -83,71 +68,8 @@ say no here and use the webConfigurator to configure VLANs later, if required.
Do you want to set up VLANs now ${yes_no_prompt}
EOD;
if ($auto_assign) {
$key = timeout();
} else
$key = chop(fgets($fp));
if (!isset($key) and $auto_assign) { // Auto Assign Interfaces
do {
echo <<<EOD
!!! Auto Assigning Interfaces !!!
For installation purposes, you must plug in at least one NIC
for the LAN connection. If you plug in a second NIC it will be
assigned to WAN. Otherwise, we'll temporarily assign WAN to the
next available NIC found regardless of activity. You should
assign and configure the WAN interface according to your requirements
If you haven't plugged in any network cables yet,
now is the time to do so.
We'll keep trying until you do.
Searching for active interfaces...
EOD;
unset($wanif, $lanif);
$media_iflist = $plugged_in = array();
$media_iflist = get_interface_list("media");
foreach ($media_iflist as $iface => $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 <<<EOD
Assigned WAN to : ${wanif}
Assigned LAN to : ${lanif}
If you don't like this assignment,
press any key to go back to manual configuration.
EOD;
$key = timeout(20);
if(isset($key))
return;
} while (!isset($wanif));
$config['system']['ssh']['enabled'] = 'enabled';
$key = 'y';
} else { //Manually assign interfaces
if (in_array($key, array('y', 'Y')))
vlan_setup();
......@@ -245,7 +167,6 @@ EOD;
break;
}
}
}
/* check for double assignments */
$ifarr = array_merge(array($lanif, $wanif), $optif);
......@@ -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 <<<EODD
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment