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 Jan 18, 2017
1 parent bc4173a commit 779403e
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 @@ -341,19 +341,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 779403e

Please sign in to comment.