mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
system: make $keep the default
This commit is contained in:
parent
09f45fbdbf
commit
397d78df9e
@ -770,8 +770,7 @@ function fixup_default_gateway($gateways_status, $gateways_arr)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* switch only if another gateway is set aa the default */
|
||||
system_default_route($dfltgwip, $ipprotocol, $gateways_arr[$dfltgwname]['friendlyiface'], isset($gateways_arr[$dfltgwname]['fargw']), true);
|
||||
system_default_route($dfltgwip, $ipprotocol, $gateways_arr[$dfltgwname]['friendlyiface'], isset($gateways_arr[$dfltgwname]['fargw']));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -417,7 +417,7 @@ function system_host_route($host, $gateway, $delete = true, $add = true)
|
||||
}
|
||||
}
|
||||
|
||||
function system_default_route($gateway, $family, $interface, $far = false, $keep = false)
|
||||
function system_default_route($gateway, $family, $interface, $far = false, $keep = true)
|
||||
{
|
||||
$realif = get_real_interface($interface);
|
||||
|
||||
@ -434,6 +434,7 @@ function system_default_route($gateway, $family, $interface, $far = false, $keep
|
||||
return;
|
||||
}
|
||||
|
||||
/* XXX we can hardcode this as soon as testing goes ok */
|
||||
if ($keep) {
|
||||
$tmpcmd = "/sbin/route -n get -{$family} default 2>/dev/null | /usr/bin/awk '/gateway:/ {print $2}'";
|
||||
$current = trim(exec($tmpcmd), " \n");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user