From: cajus Date: Fri, 1 Feb 2008 12:58:07 +0000 (+0000) Subject: Enabled wake on lan X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1c58836c832a05969f0dd9247edb426c3afbaff6;p=gosa.git Enabled wake on lan git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8720 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 55adab46f..4397b5c1d 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -781,9 +781,13 @@ sub client_input { my $query_res = $known_server_db->select_dbentry( $sql_statement ); while( my ($hit_num, $hit) = each %{ $query_res } ) { my $host_name = $hit->{hostname}; - my $host_key = $hit->{hostkey}; + my $host_key = $hit->{hostkey}; + $answer =~ s/KNOWN_SERVER/$host_name/g; &send_msg_to_target($answer, $host_name, $host_key); } + + print STDERR $answer_target."\n"; + } else { # answer is for one specific host diff --git a/gosa-si/modules/GosaPackages.pm b/gosa-si/modules/GosaPackages.pm index 33ecff2e4..e54da9aa0 100644 --- a/gosa-si/modules/GosaPackages.pm +++ b/gosa-si/modules/GosaPackages.pm @@ -285,7 +285,9 @@ sub process_gosa_msg { $out_msg = &count_jobdb } elsif ($header eq 'trigger_action_wake' ) { # Forward messages to all known servers as "trigger_wake" - $out_msg = ""; + my $in_hash= &transform_msg2hash($msg); + my %data = ( 'macAddress' => \@{$in_hash->{macAddress}} ); + $out_msg = &send_msg("trigger_wake", $server_address, "KNOWN_SERVER", \%data); } else { # msg could not be assigned to core function # fetch all available eventhandler under $server_event_dir diff --git a/gosa-si/modules/SIPackages.pm b/gosa-si/modules/SIPackages.pm index f346ae26d..81ae0671b 100644 --- a/gosa-si/modules/SIPackages.pm +++ b/gosa-si/modules/SIPackages.pm @@ -398,8 +398,7 @@ sub process_incoming_msg { } elsif ($header eq 'detected_hardware') { @out_msg_l = &process_detected_hardware($msg_hash) } elsif ($header eq 'trigger_wake') { - my $in_hash= &transform_msg2hash($msg); - foreach (@{$in_hash->{macAddress}}){ + foreach (@{$msg_hash->{macAddress}}){ &main::daemon_log("SIPackages: trigger wake for $_", 1); do_wake($_); }