summaryrefslogtreecommitdiffstats
path: root/charts.d/apcupsd.chart.sh
diff options
context:
space:
mode:
authorPaweł Krupa <pawel@krupa.net.pl>2018-09-13 00:25:07 +0200
committerCosta Tsaousis <costa@tsaousis.gr>2018-09-13 01:25:07 +0300
commitf722c9d567457920c6884ece8f7608ce1e77d270 (patch)
tree3a3df57c6a18e4e9d0e6cdaf1809f06a2acd9686 /charts.d/apcupsd.chart.sh
parentc592cea960f46a37fabd63bce657eeed55c31840 (diff)
shellcheck bash scripts starting on A; disable shebang checking in all (#4159)
scripts; set shell without shebang
Diffstat (limited to 'charts.d/apcupsd.chart.sh')
-rw-r--r--charts.d/apcupsd.chart.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/charts.d/apcupsd.chart.sh b/charts.d/apcupsd.chart.sh
index 9749b7193f..a061bd0253 100644
--- a/charts.d/apcupsd.chart.sh
+++ b/charts.d/apcupsd.chart.sh
@@ -1,3 +1,4 @@
+# shellcheck shell=bash
# no need for shebang - this file is loaded from charts.d.plugin
# SPDX-License-Identifier: GPL-3.0+
@@ -43,11 +44,12 @@ apcupsd_check() {
for host in "${!apcupsd_sources[@]}"
do
run apcupsd_get "${apcupsd_sources[${host}]}" >/dev/null
+ # shellcheck disable=2181
if [ $? -ne 0 ]
then
error "cannot get information for apcupsd server ${host} on ${apcupsd_sources[${host}]}."
failed=$((failed + 1))
- elif [ $(apcupsd_get "${apcupsd_sources[${host}]}" | awk '/^STATUS.*/{ print $3 }') != "ONLINE" ]
+ elif [ "$(apcupsd_get "${apcupsd_sources[${host}]}" | awk '/^STATUS.*/{ print $3 }')" != "ONLINE" ]
then
error "APC UPS ${host} on ${apcupsd_sources[${host}]} is not online."
failed=$((failed + 1))
@@ -183,6 +185,7 @@ END {
print \"SET time = \" time;
print \"END\"
}"
+ # shellcheck disable=SC2181
if [ $? -ne 0 ]
then
failed=$((failed + 1))