From b3d826a515a4a50d0e8f24e7e0453da2cf423e85 Mon Sep 17 00:00:00 2001 From: Sven Velt Date: Tue, 30 Aug 2011 11:30:10 +0200 Subject: [PATCH] Zypper: Check if zypper is executable Signed-off-by: Sven Velt --- check_zypper.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/check_zypper.sh b/check_zypper.sh index d467d79..04441f1 100755 --- a/check_zypper.sh +++ b/check_zypper.sh @@ -42,6 +42,12 @@ # From "/etc/sudoers" / "visudo": # nagios ALL = NOPASSWD: /usr/bin/zypper ref,/usr/bin/zypper -q pchk +# +if [ ! -x /usr/bin/zypper ] ; then + echo 'Zypper CRITICAL - Zypper not found!' + exit 2 +fi + # Refresh repositories sudo /usr/bin/zypper ref >/dev/null 2>&1