mirror of
https://github.com/webmin/webmin.git
synced 2026-06-20 03:10:30 +01:00
Add separate command before/after blacklist refresh http://virtualmin.com/node/36643
This commit is contained in:
@@ -4,4 +4,6 @@ actions=Standard actions files,9,40,5,\t
|
||||
macros=Macro files directory,0
|
||||
before_apply_cmd=Command to run before applying configuration,3,None
|
||||
after_apply_cmd=Command to run after applying configuration,3,None
|
||||
before_refresh_cmd=Command to run before refreshing blacklist,3,None
|
||||
after_refresh_cmd=Command to run after refreshing blacklist,3,None
|
||||
display_zone_descriptions=Display zone descriptions in rules file?,1,0-No,1-Yes
|
||||
|
||||
@@ -9,13 +9,13 @@ if ($access{'nochange'}) {
|
||||
}
|
||||
|
||||
&error_setup($text{'refresh_err'});
|
||||
$err = &run_before_apply_command();
|
||||
$err = &run_before_refresh_command();
|
||||
&error($err) if ($err);
|
||||
$out = &backquote_logged("$config{'shorewall'} refresh 2>&1");
|
||||
if ($?) {
|
||||
&error("<pre>$out</pre>");
|
||||
}
|
||||
$err = &run_after_apply_command();
|
||||
$err = &run_after_refresh_command();
|
||||
&webmin_log("refresh");
|
||||
&redirect("");
|
||||
|
||||
|
||||
@@ -1845,6 +1845,27 @@ if ($config{'after_apply_cmd'}) {
|
||||
}
|
||||
}
|
||||
|
||||
# run_before_refresh_command()
|
||||
# Runs the before-refresh command, if any. If it fails, returns the error
|
||||
# message output
|
||||
sub run_before_refresh_command
|
||||
{
|
||||
if ($config{'before_refresh_cmd'}) {
|
||||
local $out = &backquote_logged("($config{'before_refresh_cmd'}) </dev/null 2>&1");
|
||||
return $out if ($?);
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
# run_after_refresh_command()
|
||||
# Runs the after-refresh command, if any
|
||||
sub run_after_refresh_command
|
||||
{
|
||||
if ($config{'after_refresh_cmd'}) {
|
||||
&system_logged("($config{'after_refresh_cmd'}) </dev/null >/dev/null 2>&1");
|
||||
}
|
||||
}
|
||||
|
||||
# list_standard_actions()
|
||||
# Returns a list of standard Shorewall actions
|
||||
sub list_standard_actions
|
||||
|
||||
Reference in New Issue
Block a user