File: ntpoffset

package info (click to toggle)
gpsd 3.27.5-0.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 44,064 kB
  • sloc: ansic: 74,492; python: 16,616; sh: 890; cpp: 848; php: 225; makefile: 197; perl: 111; javascript: 26; xml: 11
file content (12 lines) | stat: -rwxr-xr-x 393 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
#!/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 distribution. 
#
# This file is Copyright 2010 by the GPSD project
# SPDX-License-Identifier: BSD-2-clause
awk '
     /127\.127\.28\.0/ { sum += $5 * 1000; cnt++; }
     END { print sum / cnt; }
' </var/log/ntpstats/peerstats