Skip to content

Commit

Permalink
- Add ssacli as an alias to hpssacli in new naming scheme
Browse files Browse the repository at this point in the history
- Rewrite check of executable to not hardcode each combination
  • Loading branch information
fredricj committed Jun 25, 2024
1 parent b212f81 commit ad50458
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions plugins-scripts/HP/Proliant.pm
Original file line number Diff line number Diff line change
Expand Up @@ -361,19 +361,16 @@ EOEO
if ($self->{runtime}->{options}->{hpacucli}) {
#1 oder 0. pfad selber finden
my $hpacucli = undef;
if (-e '/usr/sbin/hpssacli') {
$hpacucli = '/usr/sbin/hpssacli';
} elsif (-e '/usr/local/sbin/hpssacli') {
$hpacucli = '/usr/local/sbin/hpssacli';
} elsif (-e '/usr/sbin/hpacucli') {
$hpacucli = '/usr/sbin/hpacucli';
} elsif (-e '/usr/local/sbin/hpacucli') {
$hpacucli = '/usr/local/sbin/hpacucli';
} elsif (-e '/usr/sbin/hpssacli') {
$hpacucli = '/usr/sbin/hpssacli';
} elsif (-e '/usr/local/sbin/hpssacli') {
$hpacucli = '/usr/local/sbin/hpssacli';
} else {
CLIEXECTEST:
foreach my $cliexec (qw(ssacli hpssacli hpacucli)) {
foreach my $clipaths (qw(/usr/sbin/ /usr/local/sbin/ /sbin/)) {
if (-e $clipaths . $cliexec) {
$hpacucli = $clipaths . $cliexec;
last CLIEXECTEST;
}
}
}
if (! defined $hpacucli) {
$hpacucli = $hpasmcli;
$hpacucli =~ s/^sudo\s*//;
$hpacucli =~ s/hpasmcli/hpacucli/;
Expand Down

0 comments on commit ad50458

Please sign in to comment.