mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 09:34:39 +00:00
system: manual gateway switch via cron for #7027
This commit is contained in:
parent
0b42c910c4
commit
c0bee56c10
@ -35,9 +35,10 @@ require_once 'filter.inc';
|
||||
|
||||
exit_on_bootup();
|
||||
|
||||
/* when called with an argument we are in gateway switch mode */
|
||||
$recover_only = !empty($argv[1]);
|
||||
|
||||
// drop deleted routes
|
||||
/* drop deleted routes */
|
||||
foreach (glob("/tmp/delete_route_*.todo") as $filename) {
|
||||
$network = trim(file_get_contents($filename));
|
||||
$inet = (is_subnetv6($network) ? "-inet6" : "-inet");
|
||||
@ -46,7 +47,6 @@ foreach (glob("/tmp/delete_route_*.todo") as $filename) {
|
||||
}
|
||||
|
||||
system_routing_configure(true, null, !$recover_only);
|
||||
filter_configure_sync(true, false);
|
||||
|
||||
if ($recover_only) {
|
||||
foreach (dpinger_status() as $status) {
|
||||
@ -56,3 +56,5 @@ if ($recover_only) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
filter_configure_sync(true, false);
|
||||
|
||||
@ -138,6 +138,7 @@ command:/usr/local/bin/flock -n -E 0 -o /tmp/filter_reload_gateway.lock /usr/loc
|
||||
parameters:
|
||||
type:script
|
||||
message:reconfiguring routing due to gateway alarm
|
||||
description:Manual gateway switch
|
||||
|
||||
[route.del]
|
||||
command: /usr/local/opnsense/scripts/routes/del_route.py
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user