#!/bin/bash

# display the ntp status
# the server IP
# the ntp sync info

ntp_run=`/etc/init.d/ntp status | grep "is running" | wc -l`

if [ $ntp_run -eq 0 ]; then
    echo "Please start the ntp server first!"
    exit 0
fi

echo "NTP Server information:"
cat /etc/ntp-server
echo ""
echo "NTP Server Sync information:"
/usr/sbin/ntptime
echo ""
ntpq -p
exit 0

