package Ocsinventory::Agent::Backend::OS::Generic::Hostname;

sub check {
    my $params = shift;
    my $common = $params->{common};
    return 1 if $common->can_run ("hostname");
    0;
}

# Initialise the distro entry
sub run {
    my $params = shift;
    my $common = $params->{common};

    my $hostname;

    chomp ( $hostname = `hostname -f` ); # TODO: This is not generic.

    $common->setHardware ({NAME => $hostname});
}

1;
