Update system api
This commit is contained in:
19
rpi/mosquitto/config/init-mosquitto.sh
Normal file
19
rpi/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"
|
||||
|
||||
mosquitto_passwd -b "$PASSWORD_FILE" system hepl
|
||||
mosquitto_passwd -b "$PASSWORD_FILE" device 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
|
||||
echo "Starting started..."
|
||||
16
rpi/mosquitto/config/mosquitto.conf
Normal file
16
rpi/mosquitto/config/mosquitto.conf
Normal file
@@ -0,0 +1,16 @@
|
||||
persistence true
|
||||
persistence_location /mosquitto/data/
|
||||
|
||||
log_dest file /mosquitto/log/mosquitto.log
|
||||
|
||||
listener 1883 0.0.0.0
|
||||
|
||||
allow_anonymous false
|
||||
password_file /mosquitto/config/passwords
|
||||
|
||||
listener 8883 0.0.0.0
|
||||
protocol mqtt
|
||||
|
||||
certfile /mosquitto/certs/mosquitto.crt
|
||||
keyfile /mosquitto/certs/mosquitto.key
|
||||
tls_version tlsv1.2
|
||||
Reference in New Issue
Block a user