diff options
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r-- | etc/inc/system.inc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 75ea2de..7460f5a 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -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 { |