diff options
author | Jan Wagner <waja@cyconet.org> | 2017-01-06 17:43:22 +0100 |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2017-01-06 17:43:22 +0100 |
commit | 5f3232f00d07dac166b48acd6d0c92ec1ff64901 (patch) | |
tree | e497009ea444f6dabd021ad127b1500d3a8e4dff /plugins-scripts/check_sensors.sh | |
parent | 439b93049ddcfa28d7d3b8dd8085770c613aabc3 (diff) | |
download | monitoring-plugins-5f3232f00d07dac166b48acd6d0c92ec1ff64901.tar.gz |
Fixing shellcheck SC2086
Diffstat (limited to 'plugins-scripts/check_sensors.sh')
-rwxr-xr-x | plugins-scripts/check_sensors.sh | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh index 5348b175..9a6cf5de 100755 --- a/plugins-scripts/check_sensors.sh +++ b/plugins-scripts/check_sensors.sh @@ -2,43 +2,43 @@ PATH="@TRUSTED_PATH@" export PATH -PROGNAME=$(basename $0) -PROGPATH=$(echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,') +PROGNAME=$(basename "$0") +PROGPATH=$(echo "$0" | sed -e 's,[\\/][^\\/][^\\/]*$,,') REVISION="@NP_VERSION@" -. $PROGPATH/utils.sh +. "$PROGPATH"/utils.sh print_usage() { echo "Usage: $PROGNAME" [--ignore-fault] } print_help() { - print_revision $PROGNAME $REVISION + print_revision "$PROGNAME" "$REVISION" echo "" print_usage echo "" echo "This plugin checks hardware status using the lm_sensors package." echo "" support - exit $STATE_OK + exit "$STATE_OK" } case "$1" in --help) print_help - exit $STATE_OK + exit "$STATE_OK" ;; -h) print_help - exit $STATE_OK + exit "$STATE_OK" ;; --version) - print_revision $PROGNAME $REVISION - exit $STATE_OK + print_revision "$PROGNAME" "$REVISION" + exit "$STATE_OK" ;; -V) - print_revision $PROGNAME $REVISION - exit $STATE_OK + print_revision "$PROGNAME" "$REVISION" + exit "$STATE_OK" ;; *) sensordata=$(sensors 2>&1) @@ -49,10 +49,10 @@ case "$1" in elif test ${status} -ne 0; then text="WARNING - sensors returned state $status" exit=$STATE_WARNING - elif echo ${sensordata} | egrep ALARM > /dev/null; then + elif echo "${sensordata}" | egrep ALARM > /dev/null; then text="SENSOR CRITICAL - Sensor alarm detected!" exit=$STATE_CRITICAL - elif echo ${sensordata} | egrep FAULT > /dev/null \ + elif echo "${sensordata}" | egrep FAULT > /dev/null \ && test "$1" != "-i" -a "$1" != "--ignore-fault"; then text="SENSOR UNKNOWN - Sensor reported fault" exit=$STATE_UNKNOWN @@ -63,8 +63,8 @@ case "$1" in echo "$text" if test "$1" = "-v" -o "$1" = "--verbose"; then - echo ${sensordata} + echo "${sensordata}" fi - exit $exit + exit "$exit" ;; esac |