Jelajahi Sumber

Merge pull request #34 from tobixen/master

bugfix: script will throw errors if -t parameter is used - need to in…
Jon Schipp 8 tahun lalu
induk
melakukan
7a9ece5de0
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 5 1
      check_service.sh

+ 5 - 1
check_service.sh

@@ -24,6 +24,11 @@ WARNING=1
 CRITICAL=2
 UNKNOWN=3
 
+# Weather or not we can trust the exit code from the service management tool.
+# Defaults to 0, put to 1 for systemd.  Otherwise we must rely on parsing the
+# output from the service management tool.
+TRUST_EXIT_CODE=0
+
 usage()
 {
 cat <<EOF
@@ -69,7 +74,6 @@ fi
 
 
 determine_service_tool() {
-TRUST_EXIT_CODE=0
 if [[ $OS == linux ]]; then
         if command -v systemctl >/dev/null 2>&1; then
                 SERVICETOOL="systemctl status $SERVICE | grep -i Active"