loxilb UI: save loxilb configuration

save IP/LB/FW configuration from loxilb UI so
when loxilb restart or bpfire reboot, the configuration
can be restored.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
Vincent Li
2024-08-25 14:25:19 +00:00
parent 84eba5982a
commit 5f9125b044
3 changed files with 36 additions and 2 deletions

View File

@@ -630,13 +630,24 @@ sub manageFW {
}
}
sub SaveFW {
my @save_options;
my $command = 'loxicmd';
my $dir="/var/ipfire/loxilb/";
push(@save_options, "save", "--firewall", "-c", $dir);
&General::system_output($command, @save_options);
#my @output = &General::system_output($command, @save_options);
#$errormessage = join('', @output);
}
sub CreateFW {
my (%settings) = @_;
manageFW("create", %settings);
&SaveFW;
}
sub DeleteFW {
my (%settings) = @_;
manageFW("delete", %settings);
&SaveFW;
}