aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2019-02-13 15:46:42 +0100
committerDavid Runge <dave@sleepmap.de>2019-02-13 15:46:42 +0100
commit4abdc77c7e0fceaac34875d0b234070abeebdfb5 (patch)
treea62bc358005a8d6357f6647f4e7bfa7fbcbcedc6
parent6a606838ba69272dd5009f45757a503c83eb2338 (diff)
downloaduenv-4abdc77c7e0fceaac34875d0b234070abeebdfb5.tar.gz
uenv-4abdc77c7e0fceaac34875d0b234070abeebdfb5.tar.bz2
uenv-4abdc77c7e0fceaac34875d0b234070abeebdfb5.tar.xz
uenv-4abdc77c7e0fceaac34875d0b234070abeebdfb5.zip
scripts/mpd-pulse: Quoting variables.
-rwxr-xr-xscripts/mpd-pulse8
1 files 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