added logic to only backup is gateway ip is different

This commit is contained in:
2021-11-30 20:00:33 -05:00
parent 70386222c1
commit 6aa7f1d379

View File

@@ -43,8 +43,10 @@ foreach ($config['virtualip']['vip'] as $i => $vip) {
if (filter_var($gatewayIP, FILTER_VALIDATE_IP)) {
foreach ($config['gateways']['gateway_item'] as $i => $gateway) {
if ($gateway['name'] == $gatewayName) {
$config['gateways']['gateway_item'][$i]['gateway'] = $gatewayIP;
write_config_and_restart_services($wanInterface);
if ($gateway['gateway'] != $gatewayIP) {
$config['gateways']['gateway_item'][$i]['gateway'] = $gatewayIP;
write_config_and_restart_services($wanInterface);
}
}
}
}