#!/bin/bash -e

setcap cap_net_bind_service=+ep /var/vcap/packages/gorouter/bin/gorouter

<% if p("routing_api.enabled") %>
  set +e

  host <%= p("router.dns_health_check_host") %>
  if [[ "0" != "$?" ]]; then
    echo "DNS is not up"
    exit 1
  fi

  set -e
<% end %>
