updating configuration
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
FROM eclipse-mosquitto:1.6
|
||||
|
||||
ADD run.sh /run.sh
|
||||
|
||||
RUN chmod +x /run.sh
|
||||
|
||||
#CMD ["/run.sh"]
|
||||
ENTRYPOINT ["/run.sh"]
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$MQTT_USERNAME" != "" ] && [ "$MQTT_PASSWORD" != "" ];
|
||||
then
|
||||
sed -i -e 's/#allow_anonymous true/allow_anonymous false/g' /mosquitto/config/mosquitto.conf
|
||||
sed -i -e 's/#password_file/password_file \/mosquitto\/passwd/g' /mosquitto/config/mosquitto.conf
|
||||
touch /mosquitto/passwd
|
||||
mosquitto_passwd -b /mosquitto/passwd $MQTT_USERNAME $MQTT_PASSWORD
|
||||
fi
|
||||
mosquitto -c /mosquitto/config/mosquitto.conf -v
|
||||
Reference in New Issue
Block a user