docker-entrypoint.sh 915 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env bash
  2. if [ ! -z "${APPNET}" ]; then
  3. echo "Initial nslookup ${ADMIN_HOST}.${APPNET}"
  4. while [ ! $(dig tasks.${ADMIN_HOST}.${APPNET} +short) ];do \
  5. echo "Waiting for ${ADMIN_HOST}.${APPNET} to become available";sleep 1;done
  6. echo "$(hostname -i)"
  7. for i in $(hostname -i);do
  8. if [[ $(echo ${i}|cut -d. -f1-3) == $(dig tasks.${ADMIN_HOST}.${APPNET} +short|cut -d. -f1-3) ]];then
  9. echo "TASKS_SERVICE_IP=${i}" >> /vars.file
  10. echo "export TASKS_SERVICE_IP" >> /vars.file
  11. fi
  12. done
  13. echo $(dig tasks.${ADMIN_HOST}.${APPNET} +short) > /tmp/admin_ip
  14. fi
  15. echo "#Dummy" >> /etc/rc.d/init.d/functions
  16. source /etc/init.d/web-registry-portal status
  17. cat /vars.file
  18. source /vars.file
  19. rm -rf /var/run/web-registry-portal/play.pid
  20. if [ ! -z "$*" ]
  21. then
  22. exec "$@"
  23. else
  24. exec ${WEB_REGISTRY_BIN} ${WEB_REGISTRY_CUSTOM_OPTS} ${WEB_REGISTRY_OPTS}
  25. fi