Subversion Repositories camp_sysinfo_client_3

Rev

Rev 236 | 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
252 rodolico 20
#
21
# 20250330 RWR v1.2.1
22
# For Windows compatility, added 'perl' before calling perl script
41 rodolico 23
 
236 rodolico 24
# assume sysinfo-client is in our parent directory
25
my $sysinfo = dirname( abs_path( __FILE__ ) ) . '/../';
26
$sysinfo =  abs_path( $sysinfo ) . '/sysinfo-client';
27
# exit failure unless we can run it. Should never happen
252 rodolico 28
exit 1 unless ( -f $sysinfo );
236 rodolico 29
# run it with the --version flag
252 rodolico 30
my $output = `perl $sysinfo --version`;
236 rodolico 31
chomp $output;
41 rodolico 32
 
33
my $CATEGORY = 'software';
34
 
236 rodolico 35
my ($install, $version ) = split ' ', $output;
36
print "$CATEGORY\t$install\tversion\t$version\n" if $install eq 'sysinfo-client';
41 rodolico 37
 
252 rodolico 38
exit 0;