From: cajus Date: Wed, 5 Mar 2008 15:32:51 +0000 (+0000) Subject: Updated wake X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1a2f4d9d5c9f0c92d7ea6de8e929dbd2023945df;p=gosa.git Updated wake git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9362 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index 15d7f98e8..81137df2d 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -357,7 +357,9 @@ sub trigger_action_reinstall { change_fai_state('reinstall', \@{$msg_hash->{target}}); - my @out_msg_l = ($msg); + my %data = ( 'macAddress' => \@{$msg_hash->{target}} ); + my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data); + my @out_msg_l = ($wake_msg, $msg); return @out_msg_l; } @@ -368,7 +370,9 @@ sub trigger_action_update { change_fai_state('update', \@{$msg_hash->{target}}); - my @out_msg_l = ($msg); + my %data = ( 'macAddress' => \@{$msg_hash->{target}} ); + my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data); + my @out_msg_l = ($wake_msg, $msg); return @out_msg_l; } @@ -379,7 +383,9 @@ sub trigger_action_instant_update { change_fai_state('update', \@{$msg_hash->{target}}); - my @out_msg_l = ($msg); + my %data = ( 'macAddress' => \@{$msg_hash->{target}} ); + my $wake_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data); + my @out_msg_l = ($wake_msg, $msg); return @out_msg_l; } @@ -413,14 +419,13 @@ sub trigger_action_rescan { sub trigger_action_wake { my ($msg, $msg_hash) = @_; - my %data = ( 'macAddress' => \@{$msg_hash->{'macAddress'}} , - 'jobdb_id' => \@{$msg_hash->{'jobdb_id'}}, - ); + my %data = ( 'macAddress' => \@{$msg_hash->{target}} ); my $out_msg = &build_msg("trigger_wake", "GOSA", "KNOWN_SERVER", \%data); my @out_msg_l = ($out_msg); return @out_msg_l; } + sub change_fai_state { my ($st, $targets) = @_; diff --git a/gosa-si/server/events/siTriggered.pm b/gosa-si/server/events/siTriggered.pm index 578a96845..798dcb1de 100644 --- a/gosa-si/server/events/siTriggered.pm +++ b/gosa-si/server/events/siTriggered.pm @@ -13,6 +13,7 @@ use strict; use warnings; use GOSA::GosaSupportDaemon; use Socket; +use Net::hostent; BEGIN {} @@ -245,8 +246,8 @@ sub trigger_wake { foreach (@{$msg_hash->{macAddress}}){ &main::daemon_log("INFO: trigger wake for $_", 5); - my $host = shift; - my $ipaddr = shift || '255.255.255.255'; + my $host = $_; + my $ipaddr = '255.255.255.255'; my $port = getservbyname('discard', 'udp'); my ($raddr, $them, $proto);