Code

Enabled wake on lan
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 1 Feb 2008 12:58:07 +0000 (12:58 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 1 Feb 2008 12:58:07 +0000 (12:58 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8720 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server
gosa-si/modules/GosaPackages.pm
gosa-si/modules/SIPackages.pm

index 55adab46f5fda76eb8f87acb908a4286a71a8b9f..4397b5c1d1560b612a03e94f9b3f190d2b025e21 100755 (executable)
@@ -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
index 33ecff2e46d466fa4f637ea63d476e13d6704ef6..e54da9aa072138e489ab2889808a578908430b2e 100644 (file)
@@ -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 = "<xml>";
+       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
index f346ae26d566b13b025f7dcb572d6c2d7cb9e0ad..81ae0671bcd735a066190350e6b2e0f02ea1fac0 100644 (file)
@@ -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($_);
                }