summaryrefslogtreecommitdiff
path: root/contrib/ntpoffset
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-22 18:06:19 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-22 18:06:19 -0400
commitd0343667f6011cc5b1d282c5ce0819a3d55ee83f (patch)
tree94c2fc5342f56e4715750c8eda34cc21135d2713 /contrib/ntpoffset
parent46acd6444ef3e200d059d68ffb9d12ecde2bda2f (diff)
downloadgpsd-d0343667f6011cc5b1d282c5ce0819a3d55ee83f.tar.gz
Fold in Beat Bolli's ntpoffset script.
Diffstat (limited to 'contrib/ntpoffset')
-rwxr-xr-xcontrib/ntpoffset10
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/ntpoffset b/contrib/ntpoffset
new file mode 100755
index 00000000..ef97c7ce
--- /dev/null
+++ b/contrib/ntpoffset
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# Generate an estimate of your GPS's offset from a peerstats file
+# For instructions on how to use this script, see the GPSD Time
+# Service HOWTO in this distrubution.
+#
+awk '
+ /127\.127\.28\.0/ { sum += $5 * 1000; cnt++; }
+ END { print sum / cnt; }
+' </var/log/ntpstats/peerstats