From 4d9dd7a3141fd6f013a1a3957427311ffddf5c6e Mon Sep 17 00:00:00 2001 From: ludeeus Date: Mon, 25 Mar 2019 20:38:55 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20Fix=20quoting=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mqtt/rootfs/etc/cont-init.d/20-mqtt_broker.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mqtt/rootfs/etc/cont-init.d/20-mqtt_broker.sh b/mqtt/rootfs/etc/cont-init.d/20-mqtt_broker.sh index 37fd1ea..8c47333 100644 --- a/mqtt/rootfs/etc/cont-init.d/20-mqtt_broker.sh +++ b/mqtt/rootfs/etc/cont-init.d/20-mqtt_broker.sh @@ -89,18 +89,18 @@ if bashio::config.true 'broker.enabled'; then echo "acl_file $ACL_FILE" >> "$CONFIG" echo "password_file $PWFILE" >> "$CONFIG" for user in $(bashio::config 'mqttusers'); do - username=$(jq '.username' <<< "${user}") - password=$(jq '.password' <<< "${user}") - readonly=$(jq '.readonly' <<< "${user}") - topics=$(jq '.topics' <<< "${user}" | jq .[]) + username=$(jq -r '.username' <<< "${user}") + password=$(jq -r '.password' <<< "${user}") + readonly=$(jq -r '.readonly' <<< "${user}") + topics=$(jq '.topics' <<< "${user}" | jq -r .[]) bashio::log.info "Setting up user ${username}" - mosquitto_passwd -b "$PWFILE" "${username}" "${password}" - echo "user ${username}" >> "$ACL_FILE" + mosquitto_passwd -b "$PWFILE" "$username" "$password" + echo "user $username" >> "$ACL_FILE" for topic in ${topics}; do if ${readonly}; then - echo "topic read ${topic}" >> "$ACL_FILE" + echo "topic read $topic" >> "$ACL_FILE" else - echo "topic readwrite ${topic}" >> "$ACL_FILE" + echo "topic readwrite $topic" >> "$ACL_FILE" fi done done