From f96ac9c761224de43e9f71eb92b952ffdb458208 Mon Sep 17 00:00:00 2001 From: janw Date: Tue, 12 Feb 2008 13:54:42 +0000 Subject: [PATCH] Write ip and hostname to opts file additionally. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8864 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-client | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index 63567e52a..27bf2f145 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -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 { -- 2.30.2