summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-02-28 12:25:33 -0500
committerjim-p <jimp@pfsense.org>2011-02-28 12:25:33 -0500
commit566193a579a45683e9d82d8cba34db2a8d638784 (patch)
tree14b39b3fe9582f1368c097e4a0009d54d6faa74a
parentd7b4e38faa5fb6843d768bda76475e9db3f31f4e (diff)
downloadpfsense-566193a579a45683e9d82d8cba34db2a8d638784.zip
pfsense-566193a579a45683e9d82d8cba34db2a8d638784.tar.gz
Only make gateway changes if we have been given a new gateway IP.
-rw-r--r--usr/local/www/wizards/setup_wizard.xml38
1 files changed, 20 insertions, 18 deletions
diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml
index 523ad30..8d37518 100644
--- a/usr/local/www/wizards/setup_wizard.xml
+++ b/usr/local/www/wizards/setup_wizard.xml
@@ -562,26 +562,28 @@
<![CDATA[
$config['system']['hostname'] = $config['wizardtemp']['system']['hostname'];
$config['system']['domain'] = $config['wizardtemp']['system']['domain'];
- if (!is_array($config['gateways']['gateway_item']))
- $config['gateways']['gateway_item'] = array();
- $found = false;
- foreach ($config['gateways']['gateway_item'] as & $gw) {
- if ($gw['name'] == 'WANGW') {
- $found = true;
- $gw['gateway'] = $config['wizardtemp']['wangateway'];
+ if (!empty($config['wizardtemp']['wangateway'])) {
+ if (!is_array($config['gateways']['gateway_item']))
+ $config['gateways']['gateway_item'] = array();
+ $found = false;
+ foreach ($config['gateways']['gateway_item'] as & $gw) {
+ if ($gw['name'] == 'WANGW') {
+ $found = true;
+ $gw['gateway'] = $config['wizardtemp']['wangateway'];
+ }
}
+ if (!$found) {
+ $newgw = array();
+ $newgw['interface'] = "wan";
+ $newgw['gateway'] = $config['wizardtemp']['wangateway'];
+ $newgw['name'] = "WANGW";
+ $newgw['weight'] = 1;
+ $newgw['descr'] = "WAN Gateway";
+ $newgw['defaultgw'] = true;
+ $config['gateways']['gateway_item'][] = $newgw;
+ }
+ $config['interfaces']['wan']['gateway'] = "WANGW";
}
- if (!$found) {
- $newgw = array();
- $newgw['interface'] = "wan";
- $newgw['gateway'] = $config['wizardtemp']['wangateway'];
- $newgw['name'] = "WANGW";
- $newgw['weight'] = 1;
- $newgw['descr'] = "WAN Gateway";
- $newgw['defaultgw'] = true;
- $config['gateways']['gateway_item'][] = $newgw;
- }
- $config['interfaces']['wan']['gateway'] = "WANGW";
unset($config['wizardtemp']);
write_config();
reload_all();
OpenPOWER on IntegriCloud