Browse Source

Zypper: Check if zypper is executable

Signed-off-by: Sven Velt <sven@velt.de>
Sven Velt 13 năm trước cách đây
mục cha
commit
b3d826a515
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      check_zypper.sh

+ 6 - 0
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