mirror of
https://github.com/webmin/webmin.git
synced 2026-05-06 07:10:29 +01:00
Add nice header generation for saved nftables rules
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
This commit is contained in:
@@ -2024,13 +2024,20 @@ foreach my $r (@{$table->{'rules'}}) {
|
||||
return;
|
||||
}
|
||||
|
||||
# nftables_save_header()
|
||||
# Returns the generated-file header for saved rules
|
||||
sub nftables_save_header
|
||||
{
|
||||
return "# This file was auto-generated by the module.\n".
|
||||
"# Manual changes may be overwritten.\n\n";
|
||||
}
|
||||
|
||||
# dump_nftables_save(@tables)
|
||||
# Returns a string representation of the firewall rules
|
||||
sub dump_nftables_save
|
||||
{
|
||||
my (@tables) = @_;
|
||||
my $rv;
|
||||
my $rv = nftables_save_header();
|
||||
foreach my $t (@tables) {
|
||||
if ($t->{'family'}) {
|
||||
$rv .= "table $t->{'family'} $t->{'name'} {\n";
|
||||
|
||||
Reference in New Issue
Block a user