wizard: may end up duplicating WAN_GW which is bad
PR: https://forum.opnsense.org/index.php?topic=33864.0
This commit is contained in:
parent
0a3ac8fb66
commit
db69027dda
|
@ -612,19 +612,18 @@ if (!empty($config['wizardtemp']['wangateway'])) {
|
|||
$found = false;
|
||||
$defaultgw_found = false;
|
||||
foreach ($config['gateways']['gateway_item'] as & $gw) {
|
||||
if ($gw['interface'] != "wan")
|
||||
continue;
|
||||
if (isset($gw['defaultgw']))
|
||||
if (isset($gw['defaultgw'])) {
|
||||
$defaultgw_found = true;
|
||||
if ($gw['name'] == 'WAN_GW' || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway'])) {
|
||||
}
|
||||
if ($gw['name'] == 'WAN_GW') {
|
||||
$found = true;
|
||||
$gw['gateway'] = $config['wizardtemp']['wangateway'];
|
||||
$config['interfaces']['wan']['gateway'] = $gw['name'];
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$newgw = array();
|
||||
$newgw['interface'] = "wan";
|
||||
$newgw = [];
|
||||
$newgw['interface'] = 'wan';
|
||||
$newgw['gateway'] = $config['wizardtemp']['wangateway'];
|
||||
$newgw['name'] = 'WAN_GW';
|
||||
$newgw['weight'] = 1;
|
||||
|
|
Loading…
Reference in New Issue