Code

Write ip and hostname to opts file additionally.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 12 Feb 2008 13:54:42 +0000 (13:54 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 12 Feb 2008 13:54:42 +0000 (13:54 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8864 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-client

index 63567e52a06ff56b44e192d3d695ce6ea8bfb1c2..27bf2f145419acfb16b658f48555d64d1c324c8c 100755 (executable)
@@ -878,9 +878,12 @@ sub register_at_gosa_si_server {
                        my $ip= &get_local_ip_for_remote_ip(sprintf("%s", $server =~ /^([0-9\.]*?):.*$/));
                        my $resolver= Net::DNS::Resolver->new;
                        my $dnsresult= $resolver->search($ip);
+                       my $dnsname="";
                        if(!defined($dnsresult)) {
                                &write_to_file("goto-dns-error:Could not resolve hostname for ip $ip", $fai_logpath);
                                exit(1);
+                       } else {
+                               $dnsname=$dnsresult->{answer}[0]->{ptrdname};
                        }
 
             # create registration msg
@@ -905,7 +908,9 @@ sub register_at_gosa_si_server {
                                }
                                my $opts_file_FH;
                                open($opts_file_FH, ">$opts_file");
-                               print $opts_file_FH "MAC=\"$local_mac\"";
+                               print $opts_file_FH "MAC=\"$local_mac\"\n";
+                               print $opts_file_FH "IPADDRESS=\"$client_ip\"\n";
+                               print $opts_file_FH "HOSTNAME=\"$dnsname\"\n";
                                close($opts_file_FH);
                                last;
                        } else {