IsraelTorres

ntptest.sh

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