Add mosquitto entry point
This commit is contained in:
19
api-customer/mosquitto/config/init-mosquitto.sh
Normal file
19
api-customer/mosquitto/config/init-mosquitto.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
PASSWORD_FILE=/mosquitto/config/passwords
|
||||
|
||||
echo "Creating password file with pre-registered users..."
|
||||
if [ ! -f "$PASSWORD_FILE" ]; then
|
||||
touch "$PASSWORD_FILE"
|
||||
chmod 600 "$PASSWORD_FILE"
|
||||
|
||||
# Add pre-registered users
|
||||
mosquitto_passwd -b "$PASSWORD_FILE" main hepl
|
||||
mosquitto_passwd -b "$PASSWORD_FILE" pi-1 hepl
|
||||
echo "Password file created !"
|
||||
else
|
||||
echo "Password file exists, skipping this step"
|
||||
fi
|
||||
|
||||
echo "Starting mosquitto..."
|
||||
exec mosquitto -c /mosquitto/config/mosquitto.conf -v
|
||||
Reference in New Issue
Block a user