From ec8e40a0cc0755712421c41a6ebc570883e50dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20Sch=C3=B6nberger?= Date: Wed, 20 May 2015 14:43:59 +0200 Subject: [PATCH] Only add sudo if not already root --- check_lsi_raid | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/check_lsi_raid b/check_lsi_raid index 60eaa30..9a48587 100755 --- a/check_lsi_raid +++ b/check_lsi_raid @@ -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