diff --git a/drb-c2-core/mosquitto/entrypoint.sh b/drb-c2-core/mosquitto/entrypoint.sh index 27d17ce..a3f9035 100644 --- a/drb-c2-core/mosquitto/entrypoint.sh +++ b/drb-c2-core/mosquitto/entrypoint.sh @@ -24,8 +24,9 @@ if [ -z "$MQTT_NODE_USER" ] || [ -z "$MQTT_NODE_PASS" ]; then exit 1 fi -mosquitto_passwd -b "$PASSWD_FILE" "$MQTT_C2_USER" "$MQTT_C2_PASS" -mosquitto_passwd -b "$PASSWD_FILE" "$MQTT_NODE_USER" "$MQTT_NODE_PASS" +# -c creates/overwrites the file; subsequent calls append without -c +mosquitto_passwd -c -b "$PASSWD_FILE" "$MQTT_C2_USER" "$MQTT_C2_PASS" +mosquitto_passwd -b "$PASSWD_FILE" "$MQTT_NODE_USER" "$MQTT_NODE_PASS" echo "Mosquitto: password file written for users: $MQTT_C2_USER, $MQTT_NODE_USER"