mirror of
https://github.com/webmin/webmin.git
synced 2025-07-21 23:40:34 +00:00
Made iptables-save logic, match the iptables-restore logic.
This commit is contained in:
@ -407,13 +407,18 @@ local $out = &backquote_logged("cd / && $rcmd <$ipvx_save 2>&1");
|
||||
return $? ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
|
||||
sub iptables_save_command
|
||||
{
|
||||
return &has_command("ip${ipvx}tables-legacy-save") ||
|
||||
&has_command("ip${ipvx}tables-save");
|
||||
}
|
||||
|
||||
# iptables_save()
|
||||
# Saves the active firewall rules, and returns any error
|
||||
sub iptables_save
|
||||
{
|
||||
local $scmd = &has_command("ip${ipvx}tables-legacy-save") ||
|
||||
"ip${ipvx}tables-save";
|
||||
local $out = &backquote_logged("$scmd >$ipvx_save 2>&1");
|
||||
local $scmd = &iptables_save_command();
|
||||
local $out = &backquote_logged("cd / && $scmd >$ipvx_save 2>&1");
|
||||
return $? ? "<pre>$out</pre>" : undef;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user