#!/bin/bash

if curl http://216.146.38.70 --connect-timeout 5 2>&1 | grep -q -A1 "Current IP Address:"; then
    curl http://216.146.38.70 2>&1 | grep -A1 "Current IP Address:" | sed 's/^.\+Current IP Address:[[:space:]]\+\([0-9\.]*\)<.\+$/\1/'
else
    echo "Your Hypervisor cannot access the public Internet."
    echo "We recommend setting up a NAT via your control panel or enabling IP forwarding on your default gateway."
fi


