Explorar o código

Zypper: Check if zypper is executable

Signed-off-by: Sven Velt <sven@velt.de>
Sven Velt %!s(int64=13) %!d(string=hai) anos
pai
achega
b3d826a515
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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