Remove the existing default route before when can add a new one, check when it differs from the existing one

This commit is contained in:
Seth Mos 2009-12-18 21:13:32 +01:00
parent 42c462c335
commit 035a5e013f

View File

@ -308,6 +308,10 @@ function system_routing_configure() {
}
}
if(($interfacegw <> "bgpd") && (is_ipaddr($gatewayip))) {
preg_match("/default[ ]+([0-9].*?)[ ]+/i", $route_str, $elements);
if(trim($elements[1]) != "$gatewayip") {
mwexec("/sbin/route delete default " . escapeshellarg($gatewayip), false);
}
mwexec("/sbin/route add default " . escapeshellarg($gatewayip), true);
}
} else {