Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src/usr.sbin/ntp/ntptrace Pullup rev 1.6 (requested by fred...



details:   https://anonhg.NetBSD.org/src/rev/c9e0f000b233
branches:  netbsd-2-0
changeset: 561351:c9e0f000b233
user:      jmc <jmc%NetBSD.org@localhost>
date:      Mon Jun 14 03:48:14 2004 +0000

description:
Pullup rev 1.6 (requested by fredb in ticket #464)

Make this a shell script (invoking awk), rather than an awk script, to
ake the option parsing work as expected. PR#25553

diffstat:

 usr.sbin/ntp/ntptrace/ntptrace.awk |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r 0d9727c1a203 -r c9e0f000b233 usr.sbin/ntp/ntptrace/ntptrace.awk
--- a/usr.sbin/ntp/ntptrace/ntptrace.awk        Mon Jun 14 03:20:09 2004 +0000
+++ b/usr.sbin/ntp/ntptrace/ntptrace.awk        Mon Jun 14 03:48:14 2004 +0000
@@ -1,4 +1,6 @@
-#!/usr/bin/awk -f
+#!/bin/sh
+
+/usr/bin/awk '
 #
 # Based on a perl script by
 # John Hay -- John.Hay%icomtek.csir.co.za@localhost / jhay%FreeBSD.org@localhost
@@ -83,7 +85,7 @@
 
     printf("%s: stratum %d, offset %f, synch distance %f",
        dhost(host), stratum, offset, syncdistance)
-    if (stratum == 1) printf(", refid '%s'", refid)
+    if (stratum == 1) printf(", refid '\''%s'\''", refid)
     printf("\n")
 
     if (stratum == 0 || stratum == 1 || stratum == 16)
@@ -91,7 +93,7 @@
     if (refid ~ /127\.127\.[0-9]{1,3}\.[0-9]{1,3}/)
        exit 0
 
-    command = "ntpq -n -c 'pstat " peer "' " host
+    command = "ntpq -n -c '\''pstat " peer "'\'' " host
     while (command | getline) {
        gsub(/,/,"")
        nvars = split($0, vars)
@@ -126,3 +128,4 @@
     getargs()
     do_one_server()
 }
+' $@



Home | Main Index | Thread Index | Old Index