mpdstat_: unquote $NCARGS.

This commit is contained in:
ToM 2021-01-17 18:16:19 +01:00 committed by Lars Kruse
parent 9ad3b1ff18
commit 069255eee2
1 changed files with 6 additions and 3 deletions

View File

@ -89,9 +89,10 @@ ACTION="$(basename "$0" | sed 's/^.*_//')"
#
do_autoconf () {
# shellcheck disable=SC2086
if [ -z "$NCBIN" ] ; then
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)"
else
echo "yes"
@ -101,7 +102,8 @@ do_autoconf () {
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 stat_value
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"
}