Commit 9740414f authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier

Fixes: #2539 Added wake action back in Argonaut

Added it in Argonaut.pm so that it's low priority and FAI.pm can catch
Deployment.wake if it needs to
parent e8f67c4f
......@@ -30,8 +30,6 @@ use Argonaut::Common qw(:ldap :file);
my @unlocked_actions = ['System.halt', 'System.reboot'];
my @deployment_actions = ['Deployment.reboot', 'Deployman.wake'];
sub new
{
my ($class) = @_;
......@@ -50,6 +48,12 @@ sub handle_client {
return 0;
}
if ($action eq 'System.wake') {
$self->{mac} = $mac;
$self->{action} = $action;
return 1;
}
my $ip = main::getIpFromMac($mac);
eval { #try
......@@ -74,6 +78,11 @@ sub do_action {
my ($self, $params) = @_;
my $action = $self->{action};
if ($action eq 'System.wake') {
main::wakeOnLan($self->{'mac'});
return 1;
}
if ($self->{'locked'} && (grep {$_ eq $action} @unlocked_actions)) {
die 'This computer is locked';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment