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

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

Copyt trusty code

File size: 459 bytes
Line 
1package Ocsinventory::Agent::Backend::OS::HPUX::IPv4;
2
3sub check {`which ifconfig 2>&1`; ($? >> 8)?0:1 
4}
5
6# Initialise the distro entry
7sub run {
8  my $params = shift;
9  my $common = $params->{common};
10  my $ip;
11  my $hostname;
12
13  if ( `hostname` =~ /(\S+)/ )
14  {
15      $hostname=$1;
16  }
17
18  for ( `grep $hostname /etc/hosts ` )
19  {
20     if ( /(^\d+\.\d+\.\d+\.\d+)\s+/ )
21     {
22        $ip=$1;
23        $common->setHardware({IPADDR => $ip});
24     }
25  }
26}
27
281;
Note: See TracBrowser for help on using the repository browser.