|
@@ -2,12 +2,15 @@
|
|
|
|
|
|
if [ ! -z "${APPNET}" ]; then
|
|
|
echo "Initial nslookup ${ADMIN_HOST}.${APPNET}"
|
|
|
- nslookup ${ADMIN_HOST}.${APPNET}
|
|
|
- while [ $? -ne 0 ]; do
|
|
|
- echo "Waiting for ${ADMIN_HOST}.${APPNET} to become available"
|
|
|
- sleep 1
|
|
|
- nslookup ${ADMIN_HOST}.${APPNET}
|
|
|
+ while [ ! $(dig tasks.${ADMIN_HOST}.${APPNET} +short) ];do \
|
|
|
+ echo "Waiting for ${ADMIN_HOST}.${APPNET} to become available";sleep 1;done
|
|
|
+ for i in $(hostname -i);do
|
|
|
+ if [[ $(echo ${i}|cut -d. -f1-3) == $(dig tasks.${ADMIN_HOST}.${APPNET} +short|cut -d. -f1-3) ]];then
|
|
|
+# sed -i 's/local.hostname = \${HOSTNAME}.\${APPNET}/local.hostname = ${i}/' /etc/web-registry-portal/application.conf
|
|
|
+ host_ip=${i}
|
|
|
+ fi
|
|
|
done
|
|
|
+ echo $(dig tasks.${ADMIN_HOST}.${APPNET} +short) > /tmp/admin_ip
|
|
|
fi
|
|
|
|
|
|
echo "#Dummy" >> /etc/rc.d/init.d/functions
|
|
@@ -18,5 +21,5 @@ if [ ! -z "$*" ]
|
|
|
then
|
|
|
exec "$@"
|
|
|
else
|
|
|
- exec ${WEB_REGISTRY_BIN} ${WEB_REGISTRY_CUSTOM_OPTS} ${WEB_REGISTRY_OPTS}
|
|
|
+ exec TASKS_SERVICE_IP=${host_ip} ${WEB_REGISTRY_BIN} ${WEB_REGISTRY_CUSTOM_OPTS} ${WEB_REGISTRY_OPTS}
|
|
|
fi
|