File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414export USER=$1
1515export PASSWORD=` pwgen 24 1`
1616
17- echo " Will create this user:"
17+ echo " Creating this user:"
1818echo
1919echo " username: ${USER} "
2020echo " password: ${PASSWORD} "
2121echo " broker: mosquitto"
2222echo " port: 1883"
2323echo " url: mqtt://${USER} :${PASSWORD} @mosquitto:1883"
2424echo
25- echo " Only usable from within a hackstack container. To use externally, replace 'mosquitto' with the name or IP address of this server"
25+ echo " Only usable from within a hackstack container. To use externally, replace 'mosquitto' with the name or IP address or name of this server"
2626
2727echo " creating user:"
2828CMD=" docker compose -f ../docker-compose.yml exec mosquitto mosquitto_passwd -b /mosquitto/data/mos_passwd ${USER} ${PASSWORD} "
3333 echo " failed"
3434fi
3535
36+ echo " force Mosquitto to reload password file"
37+ CMD=" docker compose -f ../docker-compose.yml exec mosquitto pkill -1 mosquitto"
38+ if $CMD ; then
39+ echo " successful"
40+ else
41+ echo " failed"
42+ fi
You can’t perform that action at this time.
0 commit comments