1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 14:16:00 +00:00
This commit is contained in:
shakemid 2021-08-20 00:07:32 +09:00
parent c21acdf249
commit dd96f1861b

View file

@ -33,6 +33,7 @@
=head1 LICENSE =head1 LICENSE
GPLv2 GPLv2
SPDX-License-Identifier: GPL-2.0-only
=head1 Magic markers =head1 Magic markers
@ -58,10 +59,6 @@ interval=${interval:-0}
# Temperature unit # Temperature unit
tempunit=${tempunit:-C} tempunit=${tempunit:-C}
autoconf() {
echo 'no'
}
config() { config() {
cat <<EOF cat <<EOF
graph_title SwitchBot Meter ${deviceid} graph_title SwitchBot Meter ${deviceid}
@ -103,7 +100,7 @@ fetch_api() {
statusCode=$( echo "${response}" | jq '.statusCode' ) statusCode=$( echo "${response}" | jq '.statusCode' )
if [ "${statusCode}" -ne 100 ]; then if [ "${statusCode}" -ne 100 ]; then
echo Error with statusCode = "${statusCode}" echo Error with statusCode = "${statusCode}" 1>&2
exit 1 exit 1
fi fi
@ -113,12 +110,11 @@ fetch_api() {
# Main # Main
case ${1:-} in case ${1:-} in
autoconf)
autoconf
;;
config) config)
config config
[ "${MUNIN_CAP_DIRTYCONFIG:-}" = "1" ] && fetch if [ "${MUNIN_CAP_DIRTYCONFIG:-}" = "1" ]; then
fetch
fi
;; ;;
*) *)
fetch fetch