docker-entrypoint.sh 934 B

12345678910111213141516171819202122232425
  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. for i in $(hostname -i);do
  7. if [[ $(echo ${i}|cut -d. -f1-3) == $(dig tasks.${ADMIN_HOST}.${APPNET} +short|cut -d. -f1-3) ]];then
  8. # sed -i 's/local.hostname = \${HOSTNAME}.\${APPNET}/local.hostname = ${i}/' /etc/web-registry-portal/application.conf
  9. host_ip=${i}
  10. fi
  11. done
  12. echo $(dig tasks.${ADMIN_HOST}.${APPNET} +short) > /tmp/admin_ip
  13. fi
  14. echo "#Dummy" >> /etc/rc.d/init.d/functions
  15. source /etc/init.d/web-registry-portal status
  16. rm -rf /var/run/web-registry-portal/play.pid
  17. if [ ! -z "$*" ]
  18. then
  19. exec "$@"
  20. else
  21. exec export TASKS_SERVICE_IP=${host_ip};${WEB_REGISTRY_BIN} ${WEB_REGISTRY_CUSTOM_OPTS} ${WEB_REGISTRY_OPTS}
  22. fi