summaryrefslogtreecommitdiff
path: root/contrib
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
parent46acd6444ef3e200d059d68ffb9d12ecde2bda2f (diff)
downloadgpsd-d0343667f6011cc5b1d282c5ce0819a3d55ee83f.tar.gz
Fold in Beat Bolli's ntpoffset script.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/README4
-rwxr-xr-xcontrib/ntpoffset10
2 files changed, 14 insertions, 0 deletions
diff --git a/contrib/README b/contrib/README
index 4ade2f1f..71dc8412 100644
--- a/contrib/README
+++ b/contrib/README
@@ -41,3 +41,7 @@ display the satellite view properly. webgps.py can be called with the argument
"c" to run continously, with an integer duration and a unit suffix to run this
long (units allowed are "s", "m", "h" and "d", e.g. "4h"), or without argument
to create a snapshot of the current sat view.
+
+ntpoffset 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.
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