projects
/
ocsinventory-agent-cn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prva verzija za buster.
[ocsinventory-agent-cn.git]
/
Hostname.pm
diff --git
a/Hostname.pm
b/Hostname.pm
index
c1b5f31
..
c576c58
100644
(file)
--- a/
Hostname.pm
+++ b/
Hostname.pm
@@
-1,26
+1,22
@@
package Ocsinventory::Agent::Backend::OS::Generic::Hostname;
sub check {
package Ocsinventory::Agent::Backend::OS::Generic::Hostname;
sub check {
- eval { require (Sys::Hostname) };
- return 1 unless $@;
- `which hostname 2>&1`;
- return if ($? >> 8)!=0;
- `hostname 2>&1`;
- return if ($? >> 8)!=0;
- 1;
+ my $params = shift;
+ my $common = $params->{common};
+ return 1 if $common->can_run ("hostname");
+ 0;
}
# Initialise the distro entry
sub run {
}
# Initialise the distro entry
sub run {
- my $params = shift;
- my $inventory = $params->{inventory};
+ my $params = shift;
+ my $common = $params->{common};
- my $hostname;
+ my $hostname;
- # ico, Tue, 26 May 2009 17:58:27 +0200
- chomp ( my $hostname = `hostname --fqdn` );
+ chomp ( $hostname = `hostname -f` ); # TODO: This is not generic.
- $inventory->setHardware ({NAME => $hostname});
+ $common->setHardware ({NAME => $hostname});
}
1;
}
1;