CVS: moonbase/net/ntp BUILD, 1.3, 1.4 DETAILS, 1.4, 1.5 POST_INSTALL, 1.3, 1.4

elaine at lunar-linux.org elaine at lunar-linux.org
Sun Nov 2 16:07:08 GMT 2003


Update of /var/cvs/lunar/moonbase/net/ntp
In directory dbguin.lunar-linux.org:/tmp/cvs-serv1144

Modified Files:
	BUILD DETAILS POST_INSTALL 
Log Message:
Provide a list of strat-2 servers offering open-access, select the 4 lowest
ping times for the client's list


Index: BUILD
===================================================================
RCS file: /var/cvs/lunar/moonbase/net/ntp/BUILD,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- BUILD	10 Mar 2003 20:49:46 -0000	1.3
+++ BUILD	2 Nov 2003 16:07:06 -0000	1.4
@@ -29,10 +29,6 @@
   
   cp -rvp html /usr/share/doc/$MODULE             &&
   
-  if [ -e /etc/ntp.conf ]; then
-     mv /etc/ntp.conf /etc/config.d/ntp.conf
-  fi
- 
   if [ ! -e /etc/ntp.conf ]
    then
    cat > /etc/ntp.conf << EOF
@@ -42,8 +38,10 @@
 # file:///usr/share/docs/$MODULE/html/confopt.htm 
 # or
 # http://www.eecis.udel.edu/~ntp/documentation.html 
-server ntp.your.isp
-peer local.machine
+
+logfile /var/log/ntp.log
+driftfile /var/state/ntp.drift
+
 EOF
    fi
    

Index: DETAILS
===================================================================
RCS file: /var/cvs/lunar/moonbase/net/ntp/DETAILS,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- DETAILS	18 Oct 2003 06:44:24 -0000	1.4
+++ DETAILS	2 Nov 2003 16:07:06 -0000	1.5
@@ -8,7 +8,7 @@
    SOURCE_VFY=md5:0f8fabe87cf54f409b57c6283f0c0c3d
         WEB_SITE=http://www.ntp.org/
          ENTERED=20011004
-         UPDATED=20031018
+         UPDATED=20031102
            SHORT="ntp syncs your time with an ntp server "
 cat << EOF
 NTP (Network Time Protocol) tries to keep servers in sync

Index: POST_INSTALL
===================================================================
RCS file: /var/cvs/lunar/moonbase/net/ntp/POST_INSTALL,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- POST_INSTALL	4 Mar 2003 01:11:02 -0000	1.3
+++ POST_INSTALL	2 Nov 2003 16:07:06 -0000	1.4
@@ -1,3 +1,46 @@
-
-echo " Don't forget to edit /etc/config.d/ntp.conf "
-
+if ! grep -q server /etc/ntp.conf; then
+  SRV_LIST=$(mktemp -p /tmp -t "ntp.$$.candidates.XXXXXXX")
+  cat > $SRV_LIST << EOF 
+ntp.saard.net
+time.nrc.ca
+timelord.uregina.ca
+ntp.tuxfamily.net
+ntp1.tuxfamily.net
+ntp2.tuxfamily.net
+ntp.univ-lyon1.fr
+zg2.ntp.carnet.hr
+st.ntp.carnet.hr
+ri.ntp.carnet.hr
+os.ntp.carnet.hr
+fartein.ifi.uio.no
+ntp.shim.org
+time.ijs.si
+time.ijs.si
+ntp2a.mcc.ac.uk
+ntp2b.mcc.ac.uk
+ntp2d.mcc.ac.uk
+time-server.ndo.com
+clock.sjc.he.net
+ntp1.linuxmedialabs.com
+ntp-1.cso.uiuc.edu
+ntp-2.cso.uiuc.edu
+gilbreth.ecn.purdue.edu
+harbor.ecn.purdue.edu
+clock.psu.edu
+ntp-2.ece.cmu.edu
+ntp-1.vt.edu
+ntp.cmr.gov
+EOF
+  
+  for i in `cat $SRV_LIST`; do 
+    echo -n $i;  ping -c 2 $i | sed 's/time=//' | grep octet |          \
+    gawk '{sum += $7} END {avg=sum/FNR; printf "%20.6f \n", avg}';      \
+  done |                                                                \
+  grep -v '0\.0' | sort -n +1 | head -4 |                               \
+  gawk '{printf "server %s\n", $1}' >> /etc/ntp.conf 
+  rm -f $SRV_LIST
+  
+  echo "low ping time servers have been added to  /etc/ntp.conf "
+else
+  echo "no servers added to /etc/ntp.conf"
+fi




More information about the Lunar-commits mailing list