source: ocsinventory-agent/trunk/fuentes/lib/Ocsinventory/Agent/Backend/OS/AIX/Domains.pm @ 468

Last change on this file since 468 was 468, checked in by mabarracus, 4 years ago

Copyt trusty code

File size: 590 bytes
Line 
1package Ocsinventory::Agent::Backend::OS::AIX::Domains;
2use strict;
3
4sub run {
5  my $params = shift;
6  my $common = $params->{common};
7  my $domain;
8
9  #Domain name
10  open RESOLV, "/etc/resolv.conf";
11  while(<RESOLV>){
12                if (/^(domain|search)\s+(.+)/){$domain=$2;chomp($domain);}
13  }
14  #If no domain name and no workgroup name (samba), we send "WORKGROUP"
15  #TODO:Check if samba is present and get the windows workgroup or NT domain name
16  unless (defined($domain)){chomp($domain="WORKGROUP");}
17  $domain=~s/^.\.(.)/$1/;
18
19  $common->setHardware({
20      WORKGROUP => $domain
21    });
22
23}
24
251;
Note: See TracBrowser for help on using the repository browser.