Subversion Repositories camp_sysinfo_client_3

Rev

Rev 237 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
41 rodolico 1
#!/usr/bin/env perl
2
 
3
use strict;
4
use warnings;
236 rodolico 5
use Cwd 'abs_path';
6
use File::Basename;
41 rodolico 7
 
236 rodolico 8
our $VERSION = '1.2';
41 rodolico 9
 
10
# sysinfo module for sysinfo client
11
# Author: R. W. Rodolico
12
# Date:   2016-04-08
13
# Grabs the version of the installed sysinfo-client
57 rodolico 14
#
15
# 20171124 RWR
16
# Modified for FreeBSD
236 rodolico 17
#
18
# 20240519 RWR v1.2
19
# Assume sysinfo-client in parent directory, so just run it and have it tell us it's version
41 rodolico 20
 
236 rodolico 21
# assume sysinfo-client is in our parent directory
22
my $sysinfo = dirname( abs_path( __FILE__ ) ) . '/../';
23
$sysinfo =  abs_path( $sysinfo ) . '/sysinfo-client';
24
# exit failure unless we can run it. Should never happen
25
exit 1 unless ( -x $sysinfo );
26
# run it with the --version flag
27
my $output = `$sysinfo --version`;
28
chomp $output;
41 rodolico 29
 
30
my $CATEGORY = 'software';
31
 
236 rodolico 32
my ($install, $version ) = split ' ', $output;
33
print "$CATEGORY\t$install\tversion\t$version\n" if $install eq 'sysinfo-client';
41 rodolico 34
 
236 rodolico 35
exit 0;