Prva verzija za buster.
[ocsinventory-agent-cn.git] / Hostname.pm
1 package Ocsinventory::Agent::Backend::OS::Generic::Hostname;
2
3 sub check {
4     my $params = shift;
5     my $common = $params->{common};
6     return 1 if $common->can_run ("hostname");
7     0;
8 }
9
10 # Initialise the distro entry
11 sub run {
12     my $params = shift;
13     my $common = $params->{common};
14
15     my $hostname;
16
17     chomp ( $hostname = `hostname -f` ); # TODO: This is not generic.
18
19     $common->setHardware ({NAME => $hostname});
20 }
21
22 1;