#!/usr/bin/env bash if [ ! -z "${APPNET}" ]; then echo "Initial nslookup ${ADMIN_HOST}.${APPNET}" while [ ! $(dig tasks.${ADMIN_HOST}.${APPNET} +short) ];do \ echo "Waiting for ${ADMIN_HOST}.${APPNET} to become available";sleep 1;done echo "$(hostname -i)" for i in $(hostname -i);do if [[ $(echo ${i}|cut -d. -f1-3) == $(dig tasks.${ADMIN_HOST}.${APPNET} +short|cut -d. -f1-3) ]];then echo "TASKS_SERVICE_IP=${i}" >> /vars.file echo "export TASKS_SERVICE_IP" >> /vars.file fi done echo $(dig tasks.${ADMIN_HOST}.${APPNET} +short) > /tmp/admin_ip fi echo "#Dummy" >> /etc/rc.d/init.d/functions source /etc/init.d/web-registry-portal status cat /vars.file source /vars.file rm -rf /var/run/web-registry-portal/play.pid if [ ! -z "$*" ] then exec "$@" else exec ${WEB_REGISTRY_BIN} ${WEB_REGISTRY_CUSTOM_OPTS} ${WEB_REGISTRY_OPTS} fi