mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
mpdstat_: unquote $NCARGS.
This commit is contained in:
parent
9ad3b1ff18
commit
069255eee2
1 changed files with 6 additions and 3 deletions
|
@ -89,9 +89,10 @@ ACTION="$(basename "$0" | sed 's/^.*_//')"
|
||||||
#
|
#
|
||||||
|
|
||||||
do_autoconf () {
|
do_autoconf () {
|
||||||
|
# shellcheck disable=SC2086
|
||||||
if [ -z "$NCBIN" ] ; then
|
if [ -z "$NCBIN" ] ; then
|
||||||
echo "no (missing netcat program ('nc'))"
|
echo "no (missing netcat program ('nc'))"
|
||||||
elif ! echo stats | "$NCBIN" "$NCARGS" "$MPDHOST" "$MPDPORT" >/dev/null 2>&1; then
|
elif ! echo stats | "$NCBIN" $NCARGS "$MPDHOST" "$MPDPORT" >/dev/null 2>&1; then
|
||||||
echo "no (connection failed)"
|
echo "no (connection failed)"
|
||||||
else
|
else
|
||||||
echo "yes"
|
echo "yes"
|
||||||
|
@ -101,7 +102,8 @@ do_autoconf () {
|
||||||
|
|
||||||
|
|
||||||
get_mpd_stats_keys() {
|
get_mpd_stats_keys() {
|
||||||
echo stats | "$NCBIN" "$NCARGS" "$MPDHOST" "$MPDPORT" | awk 'BEGIN {FS=":"} /^[^ ]+:/ {print $1}'
|
# shellcheck disable=SC2086
|
||||||
|
echo stats | "$NCBIN" $NCARGS "$MPDHOST" "$MPDPORT" | awk 'BEGIN {FS=":"} /^[^ ]+:/ {print $1}'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,7 +112,8 @@ print_mpd_stat_value() {
|
||||||
local fieldname
|
local fieldname
|
||||||
local stat_value
|
local stat_value
|
||||||
fieldname="$(clean_fieldname "$key")"
|
fieldname="$(clean_fieldname "$key")"
|
||||||
stat_value="$(echo stats | "$NCBIN" "$NCARGS" "$MPDHOST" "$MPDPORT" | awk "/^${key}:/ {print \$2}")"
|
# shellcheck disable=SC2086
|
||||||
|
stat_value="$(echo stats | "$NCBIN" $NCARGS "$MPDHOST" "$MPDPORT" | awk "/^${key}:/ {print \$2}")"
|
||||||
echo "${fieldname}.value $stat_value"
|
echo "${fieldname}.value $stat_value"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue