wait.sh 494 B

1234567891011121314151617181920212223
  1. #!/bin/ash
  2. wait_for_netmaker() {
  3. echo "SERVER: ${NETMAKER_SERVER_HOST}"
  4. until curl --output /dev/null --silent --fail --head \
  5. --location "${NETMAKER_SERVER_HOST}/api/server/health"; do
  6. echo "Waiting for netmaker server to startup"
  7. sleep 1
  8. done
  9. }
  10. main(){
  11. # wait for netmaker to startup
  12. apk add curl
  13. wait_for_netmaker
  14. echo "Starting MQ..."
  15. # Run the main container command.
  16. /docker-entrypoint.sh
  17. /usr/sbin/mosquitto -c /mosquitto/config/mosquitto.conf
  18. }
  19. main "${@}"