Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # ./ntptest.sh shell script for NTP server using netcat
- # Israel Torres
- # Tue Aug 16 10:44:38 PDT 2011
- #
- if [ ! $# -lt 1 ]; then
- NTPSERVER=$1
- echo "Testing $NTPSERVER"
- echo -n '[ !!!!0000NONE111111112222222233333333Success!' | nc -w 1 -u $NTPSERVER 123 | grep 'Success!' 1> /dev/null && echo "$NTPSERVER appears good!" || echo "$NTPSERVER is not running NTP."
- else
- echo "usage: $0 'NTPSERVER'"
- echo "example: $0 time.apple.com"
- fi
- #EOF
Advertisement