Commit e9866f95 authored by Franco Fichtner's avatar Franco Fichtner

config: adhere to defaults, but force a mismatch on factory bootup; #5

parent 33fec4ae
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
<interfaces> <interfaces>
<wan> <wan>
<enable/> <enable/>
<if>em1</if> <if>mismatch1</if>
<mtu></mtu> <mtu></mtu>
<ipaddr>dhcp</ipaddr> <ipaddr>dhcp</ipaddr>
<ipaddrv6>dhcp6</ipaddrv6> <ipaddrv6>dhcp6</ipaddrv6>
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
</wan> </wan>
<lan> <lan>
<enable/> <enable/>
<if>em0</if> <if>mismatch0</if>
<ipaddr>192.168.1.1</ipaddr> <ipaddr>192.168.1.1</ipaddr>
<subnet>24</subnet> <subnet>24</subnet>
<ipaddrv6>track6</ipaddrv6> <ipaddrv6>track6</ipaddrv6>
......
...@@ -109,7 +109,8 @@ EOD; ...@@ -109,7 +109,8 @@ EOD;
if ($interactive) { if ($interactive) {
$wanif = chop(fgets($fp)); $wanif = chop(fgets($fp));
} else { } else {
$wanif = $ifnames[0]; /* more than one interface: put WAN as second one */
$wanif = count($ifnames) > 1 ? $ifnames[1] : '';
echo $wanif . PHP_EOL; echo $wanif . PHP_EOL;
} }
...@@ -135,7 +136,8 @@ EOD; ...@@ -135,7 +136,8 @@ EOD;
if ($interactive) { if ($interactive) {
$lanif = chop(fgets($fp)); $lanif = chop(fgets($fp));
} else { } else {
$lanif = ''; /* at least one interface: put LAN as first one */
$lanif = count($ifnames) > 0 ? $ifnames[0] : '';
echo $lanif . PHP_EOL; echo $lanif . PHP_EOL;
} }
...@@ -181,7 +183,13 @@ EOD; ...@@ -181,7 +183,13 @@ EOD;
printf(gettext("%sEnter the Optional %s interface name or 'a' for auto-detection%s" . printf(gettext("%sEnter the Optional %s interface name or 'a' for auto-detection%s" .
"(or nothing if finished):%s"), "\n", $io, "\n", " "); "(or nothing if finished):%s"), "\n", $io, "\n", " ");
$optif[$i] = chop(fgets($fp)); if ($interactive) {
$optif[$i] = chop(fgets($fp));
} else {
/* never configure OPT in automatic assign */
$optif[$i] = '';
echo $optif[$i] . PHP_EOL;
}
if ($optif[$i] == '') { if ($optif[$i] == '') {
unset($optif[$i]); unset($optif[$i]);
......
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