Added missing switch reading in anvil-manage-power.

Signed-off-by: digimer <mkelly@alteeve.ca>
main
digimer 1 year ago
parent ef042eef25
commit 5b286f2696
  1. 8
      tools/anvil-manage-power

@ -40,7 +40,9 @@ $anvil->Get->switches({list => [
"power-off",
"poweroff",
"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->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
# 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))
{
# 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;
$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!#",

Loading…
Cancel
Save