17 lines
400 B
Bash
17 lines
400 B
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
CONFIG_DIR="${CONFIG_DIR:-/mosquitto/config}"
|
|
RUNTIME_CONF="${RUNTIME_CONF:-/tmp/mosquitto.conf}"
|
|
MQTT_TLS_ENABLED="${MQTT_TLS_ENABLED:-true}"
|
|
|
|
case "$MQTT_TLS_ENABLED" in
|
|
true|1|yes|on)
|
|
cp "$CONFIG_DIR/mosquitto-tls.conf" "$RUNTIME_CONF"
|
|
;;
|
|
*)
|
|
cp "$CONFIG_DIR/mosquitto-plain.conf" "$RUNTIME_CONF"
|
|
;;
|
|
esac
|
|
|
|
exec mosquitto -c "$RUNTIME_CONF" |