Only add sudo if not already root

This commit is contained in:
Georg Schönberger
2015-05-20 14:43:59 +02:00
parent c00f1e8b3c
commit ec8e40a0cc

View File

@@ -1245,7 +1245,9 @@ MAIN: {
print "Error: cannot find sudo executable.\n";
exit(STATE_UNKNOWN);
}
$storcli = $sudo.' '.$storcli;
if($> != 0){
$storcli = $sudo.' '.$storcli;
}
}
}
# Print storcli version if available