|
|
|
@ -39,22 +39,21 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) |
|
|
|
|
|
|
|
|
|
my $anvil = Anvil::Tools->new(); |
|
|
|
|
|
|
|
|
|
# If the user has disabled auto-management of the firewall, exit. |
|
|
|
|
if (not $anvil->data->{sys}{manage}{firewall}) |
|
|
|
|
# Read switches |
|
|
|
|
$anvil->Get->switches({list => [ |
|
|
|
|
'job-uuid', |
|
|
|
|
"server"], man => $THIS_FILE}); |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => $anvil->data->{switches}}); |
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }}); |
|
|
|
|
|
|
|
|
|
$anvil->Database->connect(); |
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0132" }); |
|
|
|
|
if (not $anvil->data->{sys}{database}{connections}) |
|
|
|
|
{ |
|
|
|
|
# Do nothing. |
|
|
|
|
$anvil->nice_exit({exit_code => 0}); |
|
|
|
|
# No databases, exit. |
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, 'print' => 1, priority => "err", key => "error_0003"}); |
|
|
|
|
$anvil->nice_exit({exit_code => 1}); |
|
|
|
|
} |
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); |
|
|
|
|
|
|
|
|
|
# Read switches |
|
|
|
|
$anvil->data->{switches}{'job-uuid'} = ""; |
|
|
|
|
$anvil->data->{switches}{server} = ""; |
|
|
|
|
$anvil->Get->switches; |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { |
|
|
|
|
'switches::job-uuid' => $anvil->data->{switches}{'job-uuid'}, |
|
|
|
|
'switches::server' => $anvil->data->{switches}{server}, |
|
|
|
|
}}); |
|
|
|
|
|
|
|
|
|
# Log our start. |
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "message_0134"}); |
|
|
|
@ -91,6 +90,14 @@ if ($anvil->data->{switches}{'job-uuid'}) |
|
|
|
|
} |
|
|
|
|
exit(0); |
|
|
|
|
|
|
|
|
|
# If the user has disabled auto-management of the firewall, exit. |
|
|
|
|
if (not $anvil->data->{sys}{manage}{firewall}) |
|
|
|
|
{ |
|
|
|
|
# Do nothing. |
|
|
|
|
$anvil->nice_exit({exit_code => 0}); |
|
|
|
|
} |
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); |
|
|
|
|
|
|
|
|
|
# This used to do all the work, but that's now moved to the method below. So all we do here now is call it. |
|
|
|
|
$anvil->Network->manage_firewall(); |
|
|
|
|
if ($anvil->data->{switches}{'job-uuid'}) |
|
|
|
|