Răsfoiți Sursa

bugfix: script will throw errors if -t parameter is used - need to initialize
default value for the TRUST_EXIT_STATUS at the top of the script. Also added
comments about the setting.

Tobias Brox 8 ani în urmă
părinte
comite
a06e1b287a
1 a modificat fișierele cu 5 adăugiri și 1 ștergeri
  1. 5 1
      check_service.sh

+ 5 - 1
check_service.sh

@@ -23,6 +23,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
@@ -68,7 +73,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"