From 80af4fc1f7ce3eb09a641e94571f8356f6fa16bc Mon Sep 17 00:00:00 2001 From: TKE Date: Tue, 17 Dec 2019 13:37:50 +0100 Subject: [PATCH] added simple ntp query script --- get_ntp.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 get_ntp.py diff --git a/get_ntp.py b/get_ntp.py new file mode 100755 index 0000000..a362400 --- /dev/null +++ b/get_ntp.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +import ntplib +import sys +from time import ctime +c = ntplib.NTPClient() +try: + response = c.request(sys.argv[1]) + print(ctime(response.tx_time)) +except: + print("ERROR")