#!/bin/bash
# Check that the time synchronization server is reachable.
set -e

source /root/envsetup/conf.sh

NTP_SERVER="$NTP_SERVER1"
if [ "${NTP_SERVER}" = "" ]; then
    NTP_SERVER="ntp.ubuntu.com"
fi
echo "Testing NTP server: ${NTP_SERVER}"
service ntp stop
ntpdate -d ${NTP_SERVER} >/dev/null
service ntp restart