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

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

Copyt trusty code

File size: 407 bytes
Line 
1package Ocsinventory::Agent::Backend::OS::Generic::Users;
2
3sub check {
4# Useless check for a posix system i guess
5  my @who = `who 2>/dev/null`;
6  return 1 if @who;
7  return;
8}
9
10# Initialise the distro entry
11sub run {
12  my $params = shift;
13  my $common = $params->{common};
14
15  my %user;
16  # Logged on users
17  for(`who`){
18    my $user = $1 if /^(\S+)./;
19    $common->addUser ({ LOGIN => $user });
20  }
21
22}
23
241;
Note: See TracBrowser for help on using the repository browser.