summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 868da18)
raw | patch | inline | side by side (parent: 868da18)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 22 Feb 2008 16:25:29 +0000 (16:25 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 22 Feb 2008 16:25:29 +0000 (16:25 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9088 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/modules/GosaSupportDaemon.pm | patch | blob | history |
index 813ea4f02f3395385d231a5b28735ccd52d2eb92..219a2fde5193f0bda81941d569453c231bd2e41e 100644 (file)
"get_update_statement",
"get_limit_statement",
"get_orderby_statement",
+ "get_dns_domains",
);
@EXPORT = @functions;
use strict;
return $order_str;
}
+sub get_dns_domains() {
+ my $line;
+ my @searches;
+ open(RESOLV, "</etc/resolv.conf") or return @searches;
+ while(<RESOLV>){
+ $line= $_;
+ chomp $line;
+ $line =~ s/^\s+//;
+ $line =~ s/\s+$//;
+ $line =~ s/\s+/ /;
+ if ($line =~ /^domain (.*)$/ ){
+ push(@searches, $1);
+ } elsif ($line =~ /^search (.*)$/ ){
+ push(@searches, split(/ /, $1));
+ }
+ }
+ close(RESOLV);
+
+ my %tmp = map { $_ => 1 } @searches;
+ @searches = sort keys %tmp;
+
+ return @searches;
+}
+
1;