|
|
@ -40,7 +40,9 @@ $anvil->Get->switches({list => [ |
|
|
|
"power-off", |
|
|
|
"power-off", |
|
|
|
"poweroff", |
|
|
|
"poweroff", |
|
|
|
"reboot", |
|
|
|
"reboot", |
|
|
|
"reboot-needed"], man => $THIS_FILE}); |
|
|
|
"reboot-needed", |
|
|
|
|
|
|
|
"y", |
|
|
|
|
|
|
|
"yes"], man => $THIS_FILE}); |
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => $anvil->data->{switches}}); |
|
|
|
$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->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }}); |
|
|
|
|
|
|
|
|
|
|
@ -202,10 +204,10 @@ sub do_poweroff |
|
|
|
|
|
|
|
|
|
|
|
# To minimize the trouble of a problem where the reboot needed flag isn't cleared, and so the system |
|
|
|
# To minimize the trouble of a problem where the reboot needed flag isn't cleared, and so the system |
|
|
|
# wants to repeatedly reboot, we need to add a delay to not let anvil-daemon ask us to |
|
|
|
# wants to repeatedly reboot, we need to add a delay to not let anvil-daemon ask us to |
|
|
|
# reboot/power-off until the system uptime is more than ten minutes. |
|
|
|
# reboot/power-off until the system uptime is more than five minutes. |
|
|
|
if (($uptime) && ($uptime < 300)) |
|
|
|
if (($uptime) && ($uptime < 300)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
# We'll wait until the system has been running for ten minutes. |
|
|
|
# We'll wait until the system has been running for five minutes. |
|
|
|
my $difference = 300 - $uptime; |
|
|
|
my $difference = 300 - $uptime; |
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, secure => 0, key => "log_0224", variables => { |
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, secure => 0, key => "log_0224", variables => { |
|
|
|
task => $task eq "poweroff" ? "#!string!log_0225!#" : "#!string!log_0226!#", |
|
|
|
task => $task eq "poweroff" ? "#!string!log_0225!#" : "#!string!log_0226!#", |
|
|
|