From 4abdc77c7e0fceaac34875d0b234070abeebdfb5 Mon Sep 17 00:00:00 2001 From: David Runge Date: Wed, 13 Feb 2019 15:46:42 +0100 Subject: scripts/mpd-pulse: Quoting variables. --- scripts/mpd-pulse | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mpd-pulse b/scripts/mpd-pulse index 8fe5651..d20c683 100755 --- a/scripts/mpd-pulse +++ b/scripts/mpd-pulse @@ -7,9 +7,9 @@ host="$(hostname)" function connect () { - if [[ $1 != "${host}"* ]] && [[ $1 != localhost* ]]; then + if [[ "$1" != "${host}"* ]] && [[ "$1" != localhost* ]]; then echo "Connecting with host \"$1\" using pax11publish." - pax11publish -S $1 -e + pax11publish -S "$1" -e else exit 0 fi @@ -37,14 +37,14 @@ if [ ${#@} -gt 0 ]; then while getopts 'c:d:h' flag; do case "${flag}" in c) - if [ ! -z "${OPTARG}" ]; then + if [ -n "${OPTARG}" ]; then connect "${OPTARG}" else exit 1 fi ;; d) - if [ ! -z "${OPTARG}" ]; then + if [ -n "${OPTARG}" ]; then disconnect "${OPTARG}" else exit 1 -- cgit v1.2.3