Closed RincewindsHat closed 2 years ago
Ah, I misunderstood the intention there, I tried it with -g
./check_smart.pl -g /dev/sd[a-z]
Use of uninitialized value $opt_d in concatenation (.) or string at ./check_smart.pl line 104.
Oh, I didn't test with -g
, I see your point now!
May I suggest an even simpler fix:
if ($opt_d || $opt_g ) {
unless($opt_i){
print "must specify an interface for $opt_d using -i/--interface!\n\n" if $opt_d;
print "must specify an interface for $opt_g using -i/--interface!\n\n" if $opt_g;
print_help();
exit $ERRORS{'UNKNOWN'};
}
Ha, learned a little bit of Perl today, thank you
Hi and thanks for the PR. However I do not see what you are trying to achieve? The device is already in the output: