Преглед изворни кода

check_pps.sh: warning and exit when sysfs and procfs are not present

Jon Schipp пре 12 година
родитељ
комит
d3df576bb8
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      check_pps.sh

+ 6 - 0
check_pps.sh

@@ -107,6 +107,12 @@ WARN=0
 CRIT=0
 ARGC=$#
 
+# Check for dependency filesystems
+if ! [ -d /sys ] || ! [ -d /proc ]; then
+	echo "$0 requires sysfs and procfs"
+	exit $UNKNOWN
+fi
+
 # Print warning and exit if less than n arguments specified
 argcheck 1