2022-09-27 20:06:33 +08:00
|
|
|
#!/bin/ash
|
2022-09-26 19:23:32 +08:00
|
|
|
|
|
|
|
wait_for_netmaker() {
|
2022-09-27 20:06:33 +08:00
|
|
|
echo "SERVER: ${NETMAKER_SERVER_HOST}"
|
2022-09-26 19:23:32 +08:00
|
|
|
until curl --output /dev/null --silent --fail --head \
|
|
|
|
--location "${NETMAKER_SERVER_HOST}/api/server/health"; do
|
|
|
|
echo "Waiting for netmaker server to startup"
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2022-09-27 20:06:33 +08:00
|
|
|
main(){
|
|
|
|
# wait for netmaker to startup
|
|
|
|
apk add curl
|
|
|
|
wait_for_netmaker
|
|
|
|
echo "Starting MQ..."
|
|
|
|
# Run the main container command.
|
|
|
|
/docker-entrypoint.sh
|
|
|
|
/usr/sbin/mosquitto -c /mosquitto/config/mosquitto.conf
|
|
|
|
|
2022-09-26 19:23:32 +08:00
|
|
|
}
|
|
|
|
|
2022-09-30 02:32:06 +08:00
|
|
|
main "${@}"
|