#!/bin/bash

# Start the application httpd instance

# Exit on any errors
set -e

# Get gear ip address.
if ! gip=$(facter ipaddress); then
   gip=$(python -c "import socket; print socket.gethostbyname('$(hostname)')")
fi

#
# Publish this gear's HTTP URL/endpoint.
#
echo "${OPENSHIFT_GEAR_DNS}|${gip}:${OPENSHIFT_PYTHON_PROXY_PORT}"
