mirror of
https://github.com/sdr-enthusiasts/docker-planefence.git
synced 2025-12-22 11:17:06 +00:00
Fix incomplete MQTT_HOST patch logic for casesensitive creds PR#249 (#251)
* Fix incomplete MQTT_HOST patch logic for casesensitive credentials from PR#249 * minor efficiency improvement --------- Co-authored-by: renini <renini@local> Co-authored-by: kx1t <15090643+kx1t@users.noreply.github.com>
This commit is contained in:
@@ -483,7 +483,7 @@ if [[ "$(cat /tmp/pa-diff.csv | wc -l)" != "0" ]]; then
|
|||||||
|
|
||||||
# prep the MQTT host, port, etc
|
# prep the MQTT host, port, etc
|
||||||
unset MQTT_TOPIC MQTT_PORT MQTT_USERNAME MQTT_PASSWORD MQTT_HOST
|
unset MQTT_TOPIC MQTT_PORT MQTT_USERNAME MQTT_PASSWORD MQTT_HOST
|
||||||
MQTT_HOST="${MQTT_URL,,}"
|
MQTT_HOST="${MQTT_URL}"
|
||||||
MQTT_HOST="${MQTT_HOST##*:\/\/}" # strip protocol header (mqtt:// etc)
|
MQTT_HOST="${MQTT_HOST##*:\/\/}" # strip protocol header (mqtt:// etc)
|
||||||
while [[ "${MQTT_HOST: -1}" == "/" ]]; do MQTT_HOST="${MQTT_HOST:0: -1}"; done # remove any trailing / from the HOST
|
while [[ "${MQTT_HOST: -1}" == "/" ]]; do MQTT_HOST="${MQTT_HOST:0: -1}"; done # remove any trailing / from the HOST
|
||||||
if [[ $MQTT_HOST == *"/"* ]]; then MQTT_TOPIC="${MQTT_TOPIC:-${MQTT_HOST#*\/}}"; fi # if there's no explicitly defined topic, then use the URL's topic if that exists
|
if [[ $MQTT_HOST == *"/"* ]]; then MQTT_TOPIC="${MQTT_TOPIC:-${MQTT_HOST#*\/}}"; fi # if there's no explicitly defined topic, then use the URL's topic if that exists
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ if [ -f "$CSVFILE" ]; then
|
|||||||
|
|
||||||
# prep the MQTT host, port, etc
|
# prep the MQTT host, port, etc
|
||||||
unset MQTT_TOPIC MQTT_PORT MQTT_USERNAME MQTT_PASSWORD MQTT_HOST
|
unset MQTT_TOPIC MQTT_PORT MQTT_USERNAME MQTT_PASSWORD MQTT_HOST
|
||||||
MQTT_HOST="${MQTT_HOST##*:\/\/}" # strip protocol header (mqtt:// etc)
|
MQTT_HOST="${MQTT_URL##*:\/\/}" # strip protocol header (mqtt:// etc)
|
||||||
while [[ "${MQTT_HOST: -1}" == "/" ]]; do MQTT_HOST="${MQTT_HOST:0:-1}"; done # remove any trailing / from the HOST
|
while [[ "${MQTT_HOST: -1}" == "/" ]]; do MQTT_HOST="${MQTT_HOST:0:-1}"; done # remove any trailing / from the HOST
|
||||||
if [[ $MQTT_HOST == *"/"* ]]; then MQTT_TOPIC="${MQTT_TOPIC:-${MQTT_HOST#*\/}}"; fi # if there's no explicitly defined topic, then use the URL's topic if that exists
|
if [[ $MQTT_HOST == *"/"* ]]; then MQTT_TOPIC="${MQTT_TOPIC:-${MQTT_HOST#*\/}}"; fi # if there's no explicitly defined topic, then use the URL's topic if that exists
|
||||||
MQTT_TOPIC="${MQTT_TOPIC:-$(hostname)/planefence}" # add default topic if there is still none defined
|
MQTT_TOPIC="${MQTT_TOPIC:-$(hostname)/planefence}" # add default topic if there is still none defined
|
||||||
|
|||||||
Reference in New Issue
Block a user