docker-entrypoint.sh 997 B

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