|
|
|
@ -73,9 +73,6 @@ $( = $); |
|
|
|
|
# NOTE: Setting 'log_level' and 'log_secure' here will get overridden in the main lopp. Use the Log methods |
|
|
|
|
# in the loop as well to override defaults in code. |
|
|
|
|
my $anvil = Anvil::Tools->new(); |
|
|
|
|
$anvil->Log->level({set => 2}); |
|
|
|
|
$anvil->Log->secure({set => 1}); |
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); |
|
|
|
|
|
|
|
|
|
# Make sure we're running as 'root' |
|
|
|
|
# $< == real UID, $> == effective UID |
|
|
|
@ -88,8 +85,8 @@ if (($< != 0) && ($> != 0)) |
|
|
|
|
|
|
|
|
|
# Connect to the database(s). If we have no connections, we'll proceed anyway as one of the 'run_once' tasks |
|
|
|
|
# is to setup the database server. |
|
|
|
|
$anvil->Database->connect({debug => 3, check_if_configured => 1}); |
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0132"}); |
|
|
|
|
$anvil->Database->connect({check_if_configured => 1}); |
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0132"}); |
|
|
|
|
|
|
|
|
|
# If I have no databases, sleep for a second and then exit (systemd will restart us). |
|
|
|
|
if (not $anvil->data->{sys}{database}{connections}) |
|
|
|
@ -140,6 +137,8 @@ $anvil->data->{switches}{'no-start'} = 0; |
|
|
|
|
$anvil->data->{switches}{'startup-only'} = 0; |
|
|
|
|
$anvil->Get->switches; |
|
|
|
|
|
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); |
|
|
|
|
|
|
|
|
|
if ($anvil->data->{switches}{'refresh-json'}) |
|
|
|
|
{ |
|
|
|
|
$anvil->data->{switches}{'run-once'} = 1; |
|
|
|
@ -464,7 +463,7 @@ sub handle_periodic_tasks |
|
|
|
|
job_description => "job_0017", |
|
|
|
|
job_progress => 0, |
|
|
|
|
}); |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { job_uuid => $job_uuid }}); |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { job_uuid => $job_uuid }}); |
|
|
|
|
|
|
|
|
|
# Update the OUI data. |
|
|
|
|
($job_uuid) = $anvil->Database->insert_or_update_jobs({ |
|
|
|
@ -477,7 +476,7 @@ sub handle_periodic_tasks |
|
|
|
|
job_description => "job_0065", |
|
|
|
|
job_progress => 0, |
|
|
|
|
}); |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { job_uuid => $job_uuid }}); |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { job_uuid => $job_uuid }}); |
|
|
|
|
|
|
|
|
|
# Scan the networks |
|
|
|
|
($job_uuid) = $anvil->Database->insert_or_update_jobs({ |
|
|
|
@ -490,7 +489,7 @@ sub handle_periodic_tasks |
|
|
|
|
job_description => "job_0067", |
|
|
|
|
job_progress => 0, |
|
|
|
|
}); |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { job_uuid => $job_uuid }}); |
|
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { job_uuid => $job_uuid }}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# Update the next check time. |
|
|
|
|