docker-entrypoint.sh 973 B

1234567891011121314151617181920212223242526
  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. echo "TASKS_SERVICE_IP=${i}" > /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. rm -rf /var/run/web-registry-portal/play.pid
  18. if [ ! -z "$*" ]
  19. then
  20. exec "$@"
  21. else
  22. exec source /vars.file; ${WEB_REGISTRY_BIN} ${WEB_REGISTRY_CUSTOM_OPTS} ${WEB_REGISTRY_OPTS}
  23. fi