diff options
Diffstat (limited to 'scripts')
34 files changed, 489 insertions, 825 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am index dc41963..76d7655 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,4 +1,5 @@ -bin_SCRIPTS = ntp-wait ntptrace -noinst_SCRIPTS = calc_tickadj checktime freq_adj mkver ntpsweep ntpver plot_summary summary -EXTRA_DIST = fixautomakedepsmagic hpadjtime.sh monitoring ntp-close \ - ntp-groper ntp-restart ntp-status rc1 rc2 stats support +bin_SCRIPTS= ntp-wait ntptrace +noinst_SCRIPTS= calc_tickadj checktime freq_adj html2man mkver ntpsweep ntpver plot_summary summary +EXTRA_DIST = VersionName fixautomakedepsmagic genCommitLog genver \ + hpadjtime.sh monitoring ntp-close ntp-groper ntp-restart \ + ntp-status rc1 rc2 stats diff --git a/scripts/Makefile.in b/scripts/Makefile.in index ff2c46b..7aee5f7 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.7 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -21,7 +21,6 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -37,16 +36,42 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ +subdir = scripts +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/calc_tickadj.in $(srcdir)/checktime.in \ + $(srcdir)/freq_adj.in $(srcdir)/html2man.in $(srcdir)/mkver.in \ + $(srcdir)/ntp-wait.in $(srcdir)/ntpsweep.in \ + $(srcdir)/ntptrace.in $(srcdir)/ntpver.in \ + $(srcdir)/plot_summary.in $(srcdir)/summary.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ + $(top_srcdir)/m4/define_dir.m4 \ + $(top_srcdir)/m4/hs_ulong_const.m4 \ + $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/version.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = calc_tickadj checktime freq_adj html2man mkver \ + ntp-wait ntpsweep ntptrace ntpver plot_summary summary +am__installdirs = "$(DESTDIR)$(bindir)" +binSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(bin_SCRIPTS) $(noinst_SCRIPTS) +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AR = @AR@ ARLIB_DIR = @ARLIB_DIR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -54,10 +79,15 @@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -65,30 +95,39 @@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LIBOPTS_FALSE = @INSTALL_LIBOPTS_FALSE@ +INSTALL_LIBOPTS_TRUE = @INSTALL_LIBOPTS_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ +LIBOPTS_DIR = @LIBOPTS_DIR@ +LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAKE_ADJTIMED = @MAKE_ADJTIMED@ +MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@ MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@ MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@ MAKE_LIBPARSE = @MAKE_LIBPARSE@ MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@ MAKE_NTPDSIM = @MAKE_NTPDSIM@ MAKE_NTPTIME = @MAKE_NTPTIME@ -MAKE_NTP_KEYGEN = @MAKE_NTP_KEYGEN@ MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@ -MAKE_SNTP = @MAKE_SNTP@ MAKE_TICKADJ = @MAKE_TICKADJ@ MAKE_TIMETRIM = @MAKE_TIMETRIM@ +NEED_LIBOPTS_FALSE = @NEED_LIBOPTS_FALSE@ +NEED_LIBOPTS_TRUE = @NEED_LIBOPTS_TRUE@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ @@ -111,14 +150,21 @@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ U = @U@ VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -139,6 +185,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -146,66 +193,76 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ -target = @target@ target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ bin_SCRIPTS = ntp-wait ntptrace -noinst_SCRIPTS = calc_tickadj checktime freq_adj mkver ntpsweep ntpver plot_summary summary -EXTRA_DIST = fixautomakedepsmagic hpadjtime.sh monitoring ntp-close \ - ntp-groper ntp-restart ntp-status rc1 rc2 stats support +noinst_SCRIPTS = calc_tickadj checktime freq_adj html2man mkver ntpsweep ntpver plot_summary summary +EXTRA_DIST = VersionName fixautomakedepsmagic genCommitLog genver \ + hpadjtime.sh monitoring ntp-close ntp-groper ntp-restart \ + ntp-status rc1 rc2 stats -subdir = scripts -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = calc_tickadj checktime freq_adj mkver ntp-wait \ - ntpsweep ntptrace ntpver plot_summary summary -SCRIPTS = $(bin_SCRIPTS) $(noinst_SCRIPTS) - -DIST_SOURCES = -DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am calc_tickadj.in \ - checktime.in freq_adj.in mkver.in ntp-wait.in ntpsweep.in \ - ntptrace.in ntpver.in plot_summary.in summary.in all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu scripts/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -calc_tickadj: $(top_builddir)/config.status calc_tickadj.in + $(AUTOMAKE) --foreign scripts/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +calc_tickadj: $(top_builddir)/config.status $(srcdir)/calc_tickadj.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -checktime: $(top_builddir)/config.status checktime.in +checktime: $(top_builddir)/config.status $(srcdir)/checktime.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -freq_adj: $(top_builddir)/config.status freq_adj.in +freq_adj: $(top_builddir)/config.status $(srcdir)/freq_adj.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -mkver: $(top_builddir)/config.status mkver.in +html2man: $(top_builddir)/config.status $(srcdir)/html2man.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -ntp-wait: $(top_builddir)/config.status ntp-wait.in +mkver: $(top_builddir)/config.status $(srcdir)/mkver.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -ntpsweep: $(top_builddir)/config.status ntpsweep.in +ntp-wait: $(top_builddir)/config.status $(srcdir)/ntp-wait.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -ntptrace: $(top_builddir)/config.status ntptrace.in +ntpsweep: $(top_builddir)/config.status $(srcdir)/ntpsweep.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -ntpver: $(top_builddir)/config.status ntpver.in +ntptrace: $(top_builddir)/config.status $(srcdir)/ntptrace.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -plot_summary: $(top_builddir)/config.status plot_summary.in +ntpver: $(top_builddir)/config.status $(srcdir)/ntpver.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -summary: $(top_builddir)/config.status summary.in +plot_summary: $(top_builddir)/config.status $(srcdir)/plot_summary.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +summary: $(top_builddir)/config.status $(srcdir)/summary.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -binSCRIPT_INSTALL = $(INSTALL_SCRIPT) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \ - $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \ + echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done @@ -213,9 +270,18 @@ uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ done + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool uninstall-info-am: tags: TAGS TAGS: @@ -223,10 +289,6 @@ TAGS: ctags: CTAGS CTAGS: -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -240,7 +302,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -258,9 +320,10 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) - installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -272,7 +335,7 @@ install-am: all-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_STRIP_FLAG=-s \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: @@ -280,24 +343,25 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic mostlyclean-am +clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile - -distclean-am: clean-am distclean-generic +distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: +html: html-am + info: info-am info-am: @@ -314,12 +378,11 @@ installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile - maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-generic +mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am @@ -331,14 +394,15 @@ ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-info-am -.PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am info info-am install \ - install-am install-binSCRIPTS install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ - uninstall-am uninstall-binSCRIPTS uninstall-info-am +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binSCRIPTS install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-binSCRIPTS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/scripts/VersionName b/scripts/VersionName new file mode 100755 index 0000000..f601cc3 --- /dev/null +++ b/scripts/VersionName @@ -0,0 +1,41 @@ +#! /bin/sh + +# This script must be executed from the TLD of the source tree... +. ./packageinfo.sh + +NAME="$version" +case $point in + [0-9]*) + NAME="${NAME}p$point" + ;; + NEW) ;; + '') ;; + *) echo "Unexpected value for 'point' <$point>!" + exit 1 + ;; +esac + +case $special in + '') ;; + *) NAME="${NAME}-$special" ;; +esac + +case $releasecandidate in + [Nn][Oo]) ;; + [Yy][Ee][Ss]) NAME="${NAME}-RC" ;; + *) echo "Unexpected value for 'releasecandidate' <$releasecandidate>!" + exit 1 + ;; +esac + +case $repotype in + stable) + case $rcpoint in + [0-9]*) + NAME="${NAME}$rcpoint" + ;; + esac + ;; +esac + +echo "$NAME" diff --git a/scripts/genCommitLog b/scripts/genCommitLog new file mode 100755 index 0000000..2a258ad --- /dev/null +++ b/scripts/genCommitLog @@ -0,0 +1,7 @@ +#! /bin/sh + +set -e + +. packageinfo.sh +bk -R prs -hr${CLTAG}.. -nd':I:' | bk changes -m -v - > CommitLog.new +mv CommitLog.new CommitLog diff --git a/scripts/genver b/scripts/genver new file mode 100755 index 0000000..0ce1922 --- /dev/null +++ b/scripts/genver @@ -0,0 +1,67 @@ +#! /bin/sh + +# possible usage: $0 [-f] [version.m4] [version.def] +# +# -f would be 'force the update' + +force=0 +outputs= +for i in $* +do + case "$i" in + -f) force=1 ;; + version.m4) + outputs="version.m4 $outputs" + ;; + *version.def) + outputs="include/version.def $outputs" + ;; + *) echo "Unrecognized option: $i" + exit 1 + ;; + esac +done + +case "$outputs" in + '') outputs="version.m4 include/version.def" ;; +esac + +set -e + +. ./packageinfo.sh + +dversion=`scripts/VersionName` + +set +e + +case "$outputs" in + *version.m4*) + echo "m4_define([VERSION_NUMBER],[${dversion}])" > /tmp/version.m4+ + cmp -s /tmp/version.m4+ version.m4 + rc=$? + case "$force$rc" in + 00) + rm -f /tmp/version.m4+ + ;; + *) + mv /tmp/version.m4+ version.m4 + ;; + esac + ;; +esac + +case "$outputs" in + *version.def*) + echo "version = '${dversion}';" > /tmp/version.def+ + cmp -s /tmp/version.def+ include/version.def + rc=$? + case "$force$rc" in + 00) + rm -f /tmp/version.def+ + ;; + *) + mv /tmp/version.def+ include/version.def + ;; + esac + ;; +esac diff --git a/scripts/html2man.in b/scripts/html2man.in new file mode 100755 index 0000000..b7cebce --- /dev/null +++ b/scripts/html2man.in @@ -0,0 +1,172 @@ +#! @PATH_PERL@ -w +# +# html2man: Converts the NTP HTML documentation to man page format +# +# This file require the Perl HTML::TokeParser module: +# http://search.cpan.org/search?module=HTML::TokeParser +# +# Depending on where this is run from, you might need to modify $MANDIR below. +# +# Hacked together by Peter Boettcher <boettcher@ll.mit.edu> +# Last modified: <Mon Jan 28 17:24:38 2002 by pwb> + +require HTML::TokeParser; + +# use strict; # I can dream... + +$MANDIR = "./man"; + +# HTML files to convert. Also include per-file info here: +# name of man page, man section, 'see also' section +%manfiles = ( + 'ntpd' => ['ntpd', 8, 'ntp.conf(5), ntpq(8), ntpdc(8)'], + 'ntpq' => ['ntpq', 8, 'ntpd(8), ntpdc(8)'], + 'ntpdate' => ['ntpdate', 8, 'ntpd(8)'], + 'ntpdc' => ['ntpdc', 8, 'ntpd(8)'], + 'ntptime' => ['ntpdtime', 8, 'ntpd(8), ntpdate(8)'], + 'ntptrace' => ['ntptrace', 8, 'ntpd(8)'], + 'keygen' => ['ntp-keygen', 8, 'ntpd(8), ntp_auth(5)'], + 'confopt' => ['ntp.conf', 5, 'ntpd(8)'], + 'authopt' => ['ntp_auth', 5, 'ntp.conf(5), ntpd(8)'], + 'monopt' => ['ntp_mon', 5, 'ntp.conf(5)'], + 'accopt' => ['ntp_acc', 5, 'ntp.conf(5)'], + 'clockopt' => ['ntp_clock', 5, 'ntp.conf(5)'], + 'miscopt' => ['ntp_misc', 5, 'ntp.conf(5)']); + +# Disclaimer to go in SEE ALSO section of the man page +$seealso_disclaimer = 'These man pages are automatically hacked from the main NTP ' . + 'documentation pages, which are maintained in HTML format. These files are ' . + 'included in the NTP source distribution. If you installed NTP from a binary ' . + 'package, or it came pre-installed on your system, chances are the documentation ' . + 'was also included in the usual place for your system. The HTML files are more ' . + 'correct and complete than these man pages, which are provided for your reference ' . + 'only.'; + +# Disclaimer to go right at the top +$top_disclaimer = 'This file was automatically generated from HTML source, and may be ' . + 'incorrect. See the SEE ALSO section at the end of this file for more info'; + +mkdir $MANDIR, 0777; +mkdir "$MANDIR/man8", 0777; +mkdir "$MANDIR/man5", 0777; + +# Do the actual processing +foreach $file (keys %manfiles) { + process($file); +} +# End of main function + + + +# Do the real work +sub process { + my($filename) = @_; + $fileinfo = $manfiles{$filename}; + + $p = HTML::TokeParser->new("$filename.html") || die "Can't open $filename.html: $!"; + open(MANOUT, ">$MANDIR/man$fileinfo->[1]/$fileinfo->[0].$fileinfo->[1]") + || die "Can't open: $!"; + + $p->get_tag("title"); + $name = $p->get_text("/title"); + $p->get_tag("hr"); # Skip past image and quote, hopefully + + # Setup man header + print MANOUT ".TH " . $fileinfo->[0] . " " . $fileinfo->[1] . "\n"; + print MANOUT ".UC 4\n"; + print MANOUT ".SH NAME\n"; + $pat = $fileinfo->[0]; + if ($name =~ /$pat/) { + } else { + # Add the manpage name, if not in the HTML title already + print MANOUT "$fileinfo->[0] - "; + } + print MANOUT "$name\n\n"; + + print MANOUT "$top_disclaimer\n"; + + # Now start scanning. We basically print everything after translating some tags. + # $token->[0] has "T", "S", "E" for Text, Start, End + # $token->[1] has the tag name, or text (for "T" case) + # Theres lots more in the world of tokens, but who cares? + while (my $token = $p->get_token) { + if($token->[0] eq "T") { + my $text = $token->[1]; + if($tag) { + $text =~ s/^[\n ]*//; + $text =~ s/[\n ]*$/ /; + } + $text =~ s/ \;/ /g; + $text =~ s/^\./\\./; + print MANOUT "$text"; + $tag = 0; + } + if($token->[0] eq "S") { + if($token->[1] eq "h4") { + my $text = uc($p->get_trimmed_text("/h4")); + print MANOUT ".SH $text\n"; + } + if($token->[1] eq "tt") { + push @fontstack, "tt"; + print MANOUT "\\fB"; + } + if($token->[1] eq "i") { + push @fontstack, "i"; + print MANOUT "\\fI"; + } + if($token->[1] eq "address") { + my $text = $p->get_trimmed_text("/address"); + print MANOUT "\n.SH AUTHOR\n$text\n"; + } + if($token->[1] eq "dt") { + $tmp = $deflevel-4; + print MANOUT "\n.RS $tmp\n"; + $tag = 1; + } + if($token->[1] eq "dd") { + print MANOUT "\n.RS $deflevel\n"; + $tag = 1; + } + if($token->[1] eq "dl") { + $deflevel+=4; + } + } + elsif($token->[0] eq "E") { + if($token->[1] eq "dd") { + print MANOUT "\n.RE\n"; + $tag = 1; + } + if($token->[1] eq "tt") { + $f = pop @fontstack; + if($f ne "tt") { + warn "Oops, mismatched font! Trying to continue\n"; + } + if ($#fontstack < 0) { $fontswitch = "\\fR"; } + elsif ($fontstack[$#fontstack] eq "tt") { $fontswitch = "\\fB"; } + else { $fontswitch = "\\fI"; } + print MANOUT "$fontswitch"; + } + if($token->[1] eq "i") { + $f = pop @fontstack; + if($f ne "i") { + warn "Oops, mismatched font! Trying to continue\n"; + } + if ($#fontstack < 0) { $fontswitch = "\\fR"; } + elsif ($fontstack[$#fontstack] eq "tt") { $fontswitch = "\\fB"; } + else { $fontswitch = "\\fI"; } + print MANOUT "$fontswitch"; + } + if($token->[1] eq "dl") { + $deflevel-=4; + } + if($token->[1] eq "dt") { + print MANOUT "\n.RE"; + $tag = 1; + } + } + } + print MANOUT ".SH SEE ALSO\n\n"; + print MANOUT "$fileinfo->[2]\n\n"; + print MANOUT "$seealso_disclaimer\n"; + close(MANOUT); +} diff --git a/scripts/mkver.in b/scripts/mkver.in index dbe9c2a..11aa613 100644 --- a/scripts/mkver.in +++ b/scripts/mkver.in @@ -10,17 +10,14 @@ case "$CSET" in *) ConfStr="$ConfStr@$CSET" ;; esac -case "@LIBRSAREF@" in - '') - case "@AUTOKEY@" in - '') ;; - *) ConfStr="${ConfStr}-a" ;; - esac - ;; - *) ConfStr="${ConfStr}-r" ;; +case "@LCRYPTO@" in + '') ;; + -lcrypto) + ConfStr="${ConfStr}-o" ;; + *) ConfStr="${ConfStr}-?" ;; esac -ConfStr="$ConfStr `LC_TIME=C date`" +ConfStr="$ConfStr `LC_TIME=C TZ= date`" if [ ! -f .version ]; then echo 0 > .version diff --git a/scripts/monitoring/lr.pl b/scripts/monitoring/lr.pl index 7980d22..1ab3e3f 100644 --- a/scripts/monitoring/lr.pl +++ b/scripts/monitoring/lr.pl @@ -52,7 +52,7 @@ sub init $self->{sy2} = 0.0; } -sub sample($$$) +sub sample($$) { my $self = shift; my($_x, $_y) = @_; @@ -65,7 +65,7 @@ sub sample($$$) $self->{sy2} += $_y**2; } -sub B($) +sub B() { my $self = shift; @@ -74,28 +74,28 @@ sub B($) / ($self->{n} * $self->{sx2} - $self->{sx}**2); } -sub A($) +sub A() { my $self = shift; - return ($self->{sy} - B($self) * $self->{sx}) / $self->{n}; + return ($self->{sy} - B() * $self->{sx}) / $self->{n}; } -sub Y($$) +sub Y() { my $self = shift; - return A($self) + B($self) * $_[$[]; + return A() + B() * $_[$[]; } -sub X($$) +sub X() { my $self = shift; - return ($_[$[] - A($self)) / B($self); + return ($_[$[] - A()) / B(); } -sub r($) +sub r() { my $self = shift; @@ -107,7 +107,7 @@ sub r($) return ($self->{n} * $self->{sxy} - $self->{sx} * $self->{sy}) / sqrt($s); } -sub cov($) +sub cov() { my $self = shift; @@ -115,7 +115,7 @@ sub cov($) / ($self->{n} - 1); } -sub sigma($) +sub sigma() { my $self = shift; @@ -124,7 +124,7 @@ sub sigma($) / ($self->{n})); } -sub mean($) +sub mean() { my $self = shift; diff --git a/scripts/monitoring/ntploopwatch b/scripts/monitoring/ntploopwatch index db661d3..a94695c 100644 --- a/scripts/monitoring/ntploopwatch +++ b/scripts/monitoring/ntploopwatch @@ -1,8 +1,7 @@ #!/usr/bin/perl -w ;# --*-perl-*-- ;# -;# /src/NTP/ntp-4/scripts/monitoring/ntploopwatch,v 4.3 1999/02/21 12:18:38 kardel RELEASE_19990228_A -;# RELEASE_19990228_A +;# /src/NTP/ntp4-dev/scripts/monitoring/ntploopwatch,v 4.7 2004/11/14 16:11:05 kardel RELEASE_20050508_A ;# ;# process loop filter statistics file and either ;# - show statistics periodically using gnuplot @@ -55,7 +54,7 @@ a file of this name instead of delivered to a printer. E-O-P ;# add directory to look for lr.pl and timelocal.pl (in front of current list) -unshift(@INC,"/usr/local/xntp/monitoring"); +unshift(@INC,"."); require "lr.pl"; # linear regresion routines @@ -438,8 +437,9 @@ sub read_config print "configuration file read\n" if $verbose > 2; } -sub make_doplot +sub make_doplot($$) { + my($lo, $lf) = @_; local($c) = (""); local($fmt) = ("%s \"%s\" using 1:%d title '%s <%lf %lf> %6s' with lines"); @@ -536,22 +536,22 @@ sub make_doplot $c = ","); $showoreg && $showoffs && ($doplot .= sprintf($regfmt, $c, - &lr_B('offs'),&lr_A('offs'), + $lo->B(),$lo->A(), "offset ", - &lr_B('offs'), - ((&lr_A('offs')) < 0 ? '-' : '+'), - &abs(&lr_A('offs')), &lr_r('offs'), + $lo->B(), + (($lo->A()) < 0 ? '-' : '+'), + &abs($lo->A()), $lo->r(), "[ms]"), $c = ","); $showfreg && $showfreq && ($doplot .= sprintf($regfmt, $c, - &lr_B('freq') * $FreqScale, - (&lr_A('freq') + $minfreq) * $FreqScale - $LastFreqBase, + $lf->B() * $FreqScale, + ($lf->A() + $minfreq) * $FreqScale - $LastFreqBase, "frequency", - &lr_B('freq') * $FreqScale, - ((&lr_A('freq') + $minfreq) * $FreqScale - $LastFreqBase) < 0 ? '-' : '+', - &abs((&lr_A('freq') + $minfreq) * $FreqScale - $LastFreqBase), - &lr_r('freq'), + $lf->B() * $FreqScale, + (($lf->A() + $minfreq) * $FreqScale - $LastFreqBase) < 0 ? '-' : '+', + &abs(($lf->A() + $minfreq) * $FreqScale - $LastFreqBase), + $lf->r(), "[${FreqScaleInv}ppm]"), $c = ","); $doplot .= "\n"; @@ -566,7 +566,7 @@ sub make_doplot sub genfile { - local($cnt,$in,$out,@fpos) = @_; + local($cnt,$in,$out,$lo,$lf,@fpos) = @_; local(@F,@t,$t,$lastT) = (); local(@break,@time,@offs,@freq,@cmpl,@loffset,@filekey) = (); @@ -1058,9 +1058,6 @@ sub genfile print "input scanned ($l lines/",scalar(@time)," samples)\n" if $verbose > 1; - &lr_init('offs'); - &lr_init('freq'); - if (@time) { local($_,@F); @@ -1110,13 +1107,13 @@ sub genfile ;# (otherwise a (shift(@a1),shift(a2)) would do), ;# I dont like to make copies of these arrays as they may be huge $i = $[; - &lr_sample(($time[$i]-$timebase)/3600,$offs[$i],'offs'),$i++ + $lo->sample(($time[$i]-$timebase)/3600,$offs[$i]),$i++ while $i <= $#time; ($minoffs == $maxoffs) && ($minoffs -= 0.1,$maxoffs += 0.1); - $i = &lr_sigma('offs'); - $m = &lr_mean('offs'); + $i = $lo->sigma(); + $m = $lo->mean(); print "mean offset: $m sigma: $i\n" if $verbose > 2; @@ -1156,12 +1153,12 @@ sub genfile $maxfreq = &max(@freq); $i = $[; - &lr_sample(($time[$i]-$timebase)/3600,$freq[$i]-$minfreq,'freq'), + $lf->sample(($time[$i]-$timebase)/3600,$freq[$i]-$minfreq), $i++ while $i <= $#time; - $i = &lr_sigma('freq'); - $m = &lr_mean('freq') + $minfreq; + $i = $lf->sigma(); + $m = $lf->mean() + $minfreq; print "mean frequency: $m sigma: $i\n" if $verbose > 2; @@ -1185,7 +1182,7 @@ sub genfile ($FreqScale == 1 ? "" : (1/$FreqScale)); $freqbase = ($maxfreq + $minfreq)/ 2 * $FreqScale; #$m * $FreqScale; - $freqbase -= ($maxy + $miny) / 2; #&lr_mean('offs'); + $freqbase -= ($maxy + $miny) / 2; #$lf->mean(); ;# round resulting freqbase ;# to precision of min max difference @@ -1306,10 +1303,10 @@ sub genfile ;# prevent plotcmd from processing empty file print "Creating plot command dummy...\n" if $verbose > 2; print OUT "# dummy samples\n0 1 2 3\n1 1 2 3\n"; - &lr_sample(0,1,'offs'); - &lr_sample(1,1,'offs'); - &lr_sample(0,2,'freq'); - &lr_sample(1,2,'freq'); + $lo->sample(0,1); + $lo->sample(1,1); + $lf->sample(0,2); + $lf->sample(1,2); @time = (0, 1); $maxtime = 1; $mintime = 0; @offs = (1, 1); $maxoffs = 1; $minoffs = 1; @freq = (2, 2); $maxfreq = 2; $minfreq = 2; @@ -1453,10 +1450,13 @@ while(1) &read_config;# unless defined($PrintIt); unlink($tmpfile); - @filepos = &genfile($samples,$srcprefix,$tmpfile,@filepos); + my $lo = lr->new(); + my $lf = lr->new(); + + @filepos = &genfile($samples,$srcprefix,$tmpfile,$lo,$lf,@filepos); ;# make plotcmd display samples - &make_doplot; + make_doplot($lo, $lf); print "Displaying plot...\n" if $verbose > 1; print "command for plot sub process:\n$doplot----\n" if $verbose > 3; print PLOT $doplot; diff --git a/scripts/ntpsweep.in b/scripts/ntpsweep.in index 156fb45..e503a06 100644 --- a/scripts/ntpsweep.in +++ b/scripts/ntpsweep.in @@ -16,8 +16,7 @@ # purpose. The name Origin B.V. must not be used to endorse or promote # products derived from this software without prior written permission. # -# Hans Lambermont <Hans.Lambermont@nl.origin-it.com>/<H.Lambermont@chello.nl> -# 14 Jan 2000 +# Hans Lambermont <ntpsweep@lambermont.dyndns.org> require 5.0; # But actually tested on 5.004 ;) use Getopt::Long; # GetOptions() diff --git a/scripts/ntptrace.in b/scripts/ntptrace.in index 8545b2c..c3c2a20 100755 --- a/scripts/ntptrace.in +++ b/scripts/ntptrace.in @@ -4,19 +4,26 @@ use Socket; use Getopt::Std; -use vars qw($opt_n); +use vars qw($opt_n $opt_m); $ntpq = "ntpq"; -getopts('n'); +getopts('nm:'); $dodns = 1; $dodns = 0 if (defined($opt_n)); +$max_hosts = (defined($opt_m) ? $opt_m : 99); +$max_hosts = 0 if ( $max_hosts !~ /^\d+$/ ); +$nb_host = 1; + $host = shift; $host ||= "127.0.0.1"; for (;;) { + $nb_host++; + $rootdelay = 0; + $rootdispersion = 0; $stratum = 255; $cmd = "$ntpq -n -c rv $host"; open(PH, $cmd . "|") || die "failed to start command $cmd: $!"; @@ -26,12 +33,13 @@ for (;;) { # Very old servers report phase and not offset. $offset = $1 if (/(?:offset|phase)=([^\s,]+)/); $rootdelay = $1 if (/rootdelay=([^\s,]+)/); + $rootdispersion = $1 if (/rootdispersion=([^\s,]+)/); $refid = $1 if (/refid=([^\s,]+)/); } close(PH) || die "$cmd failed"; last if ($stratum == 255); $offset /= 1000; - $rootdelay /= 1000; + $syncdistance = ($rootdispersion + ($rootdelay / 2)) / 1000; $dhost = $host; # Only do lookups of IPv4 addresses. The standard lookup functions # of perl only do IPv4 and I don't know if we should require extras. @@ -40,12 +48,13 @@ for (;;) { $name = (gethostbyaddr($iaddr, AF_INET))[0]; $dhost = $name if (defined($name)); } - printf("%s: stratum %d, offset %f, root distance %f", - $dhost, $stratum, $offset, $rootdelay); + printf("%s: stratum %d, offset %f, synch distance %f", + $dhost, $stratum, $offset, $syncdistance); printf(", refid '%s'", $refid) if ($stratum == 1); printf("\n"); last if ($stratum == 0 || $stratum == 1 || $stratum == 16); last if ($refid =~ /^127\.127\.\d{1,3}\.\d{1,3}$/); + last if ($nb_host > $max_hosts); $cmd = "$ntpq -n -c \"pstat $peer\" $host"; open(PH, $cmd . "|") || die "failed to start command $cmd: $!"; @@ -55,6 +64,7 @@ for (;;) { } close(PH) || die "$cmd failed"; last if ($thost eq ""); + last if ($thost =~ /^127\.127\.\d{1,3}\.\d{1,3}$/); $host = $thost; } diff --git a/scripts/support/README b/scripts/support/README deleted file mode 100644 index 812965b..0000000 --- a/scripts/support/README +++ /dev/null @@ -1,73 +0,0 @@ -The bin and etc directories contain several scripts (sh and perl) that -should ease startup and configuration of NTP sites. - - bin/monl is a monitoring script that prints out new, current and - old customers of an NTP timeserver when monitoring is - in effect. - monl has following options: - -i <regexp> (regular expression matchin IP addres to be ignored - -d <directory> where the current state is kept (default /tmp) - -v debug output - -n do not translate IP addresses into hostnames - <host> host to be analyzed - - monl uses xntpdc for information gathering and is thus - limited to the NTP version xntpdc is compiled for. - - bin/mvstats moves compresses and removes statistics files (useful mainly - for reference servers - - etc/install creates the locally needed directories for NTP (if not residung in /etc) - - etc/rc starts up daemon with configuration file and key file - etc/cron cron called monitor statistic (uses bin/monl) - etc/crontab crontab prototype for reference time servers - etc/setup sh script sourced by the other scripts for variable setup - -YOU MUST EDIT THESE FILES TO REFLECT YOUR LOCAL SETUP ! - -READ THIS BEFORE USING THE STARTUP SCRIPTS - -The startupscript etc/rc has been written for Suns and HPs. They are not -guaranteed to work elsewhere. Following assumptions have been made: - - All NTP related files reside in ONE directory having following structure: - - bin/* - all executables (daemon, control, date, scripts) - etc/* - startup scripts and cron scripts - conf/* - NTP configuration files - -The variable NTPROOT (etc/rc, etc/install) must be edited to reflect -the NTP directory (e.g. /usr/local/NTP) - -NTP config files are located via Suns arch command and have the name -conf/`arch`.`arch -k`. -These are the default configurations (usually clients). If a file with the name -conf/`arch`.`arch -k`.`hostname` is present this file will be preferred (Reference host, -gateway). If the arch command is not available no-arch is used. The arch command -is usually a shell script which echoes a string unique the the current machine -architecture. - -The tickadj command has its own conf/tickconf file which is used to set host -specific tickadj values. The line with DEFAULT specifies the default tickadj -parameters, all other lines consists of <hostname> <hostid> -<tickadj parameters>. These lines need only be entered if the specified host -needs parameters different from the default parameters. - -Reference clock support is provided for DCF77. If you need to initialize -certain things for reference clock support (e.g. loading STREAMS modules), -you need to edit etc/rc. - -The current config files of Erlangen are included in the conf directory. -They are just for reference, but might help you a bit in setting up a -synchronisation network. - -The advantage of keeping all config files centralized is the easier -administration. - -We replicate the NTP directory via NFS and rdist. - -When you have set up the local config files (YOUR OWN!) you can call -<NTPROOT>/etc/rc for daemon startup. - -For more information: time@informatik.uni-erlangen.de diff --git a/scripts/support/bin/monl b/scripts/support/bin/monl deleted file mode 100644 index f0c48db..0000000 --- a/scripts/support/bin/monl +++ /dev/null @@ -1,213 +0,0 @@ -#!/local/bin/perl - -%service = ( 0, "unspec", - 1, "Active", - 2, "Passive", - 3, "Client", - 4, "Server", - 5, "Broadcast", - 6, "Control", - 7, "Private" ); -%nc = (); -@ignpat = (); -$noname = 0; -$verbose = 0; -$retries = 5; -$lastkey = 0; - -sub timedelta { - local($tm, $days, $h, $m, $s); - - $tm = @_[$[]; - $days = 0; - $days = sprintf("%dd+", $days) if $days = int($tm / (60*60*24)); - $days = "" unless $days; - $tm = $tm % (60*60*24); - $h = int($tm / (60*60)); - $tm = $tm % (60*60); - $m = int($tm / 60); - $s = $tm % 60; - - return sprintf("%s%02d:%02d:%02d", $days, $h, $m, $s); -} - -sub listentry { - local($host, $mode) = split("$;" , @_[$[]); - local($count, $version, $firsttime) = split("$;" , $_[$[+1]); - local($name); - - if (grep($host =~ m/$_/, @ignpat)) - { - print "ignored $host ...\n" if $verbose; - return; - } - - return if ! $count; - - if (defined($nc{$host})) - { - $name = $nc{$host}; - } - else - { - if ($noname) - { - $nc{$host} = $name = $host; - } - else - { - $name = (gethostbyaddr(pack("C4", split(/\./, $host)), 2))[$[]; - $nc{$host} = $name = $host if ! defined($name); - } - } - - printf ($fmt, ($lastkey eq $host) ? "" : $name, $service{$mode}, $count, $version, &timedelta($firsttime), $firsttime / $count); - - if (@_[$[+2]) - { - $hostcnt++ if $lastkey ne $host; - $packcnt += $count; - $maxtime = $firsttime if $firsttime > $maxtime; - } - - $lastkey = $host; -} - -while ($ARGV[$[] =~ /^-[nvid]$/) - { - if ($ARGV[$[] eq "-i") - { - shift; - push(@ignpat, shift) unless ! defined($ARGV[$[]); - } - elsif ($ARGV[$[] eq "-d") - { - shift; - $dir = shift unless ! defined($ARGV[$[]); - } - elsif ($ARGV[$[] eq "-n") - { - shift; - $noname = 1; - } - elsif ($ARGV[$[] eq "-v") - { - shift; - $verbose = 1; - } - } - -$dir = "/tmp" unless defined($dir); -$gone = 60*60*48; -$fmt = "%48s %10s %7d %7d %13s %14.3f\n"; -$sfmt = "%48s %10s %7s %7s %13s %14s\n"; -@lbl = ("Host", "Mode", "Count", "Version", "Time active", "Packetinterval"); - -if (!defined($ARGV[$[])) - { - $hostname = `hostname`; - chop($hostname); - unshift(@ARGV, $hostname); - } - -foreach $hostname (@ARGV) - { - $dbmfile = $dir . "/monlstats-" . $hostname; - $monl = "xntpdc -c 'hostnames no' -c monl $hostname | tail +3 |"; - $hostcnt = 0; - $packcnt = 0; - $maxtime = 0; - %Seen = (); - %New = (); - %Old = (); - - print "Monitor Status of $hostname\n\n"; - - $cnt = $retries; - do - { - open(MONL, $monl) || die("$monl failed $!"); - @monlout = <MONL>; - close(MONL); - } while (! @monlout && $cnt--); - - if (! @monlout) - { - print "not available.\n"; - next; - } - - dbmopen(Clients, $dbmfile, 0644) || die("dbmopen(.., $dbmfile, ...): $!"); - - foreach (@monlout) - { - chop; - split; - ($host, $count, $mode, $version, $lasttime, $firsttime) = - (@_[$[, $[+2 .. $[+4, $#_-1,$#_]); - - $Seen{$host, $mode} = 1; - - if (!defined($Clients{$host, $mode})) - { - if ($lasttime <= $gone) - { - ## got a new one - $Clients{$host, $mode} = $New{$host, $mode} = join("$;", $count, $version, $firsttime, $lasttime); - } - } - else - { - ## throw out the old ones - if ($lasttime > $gone) - { - $Old{$host, $mode} = $Clients{$host, $mode}; - delete $Clients{$host, $mode}; - } - else - { - $Clients{$host, $mode} = join("$;", $count, $version, $firsttime, $lasttime); - } - } - } - - grep(($Seen{$_} || ($Old{$_} = delete $Clients{$_})), keys(%Clients)); - - if (grep(($tmp = $_ , !grep($tmp =~ m/$_/, @ignpat)), keys(%New))) - { - print "New customers\n"; - print "-------------\n"; - printf $sfmt, @lbl; - grep( &listentry($_, $New{$_}, 1), sort(keys(%New)) ); - print "\n"; - } - - - if (grep((!defined($New{$_}) && ($tmp = $_, !grep($tmp =~ m/$_/, @ignpat))), keys(%Clients))) - { - print "Current customers\n"; - print "-----------------\n"; - printf $sfmt, @lbl; - grep( defined($New{$_}) || &listentry($_, $Clients{$_}, 1) , sort(keys(%Clients)) ); - print "\n"; - } - - if (grep(($tmp = $_, !grep($tmp =~ m/$_/, @ignpat)), keys(%Old))) - { - print "Discarded customers\n"; - print "-------------------\n"; - printf $sfmt, @lbl; - grep( &listentry($_, $Old{$_}, 0) , sort(keys(%Old)) ); - print "\n"; - } - - dbmclose(Clients); - - print "\nSummary:\n"; - print "--------\n"; - printf("Elapsed time: %13s\n", &timedelta($maxtime)); - printf(" Hosts: %13d\n", $hostcnt); - printf(" Packets: %13d\n", $packcnt); - printf(" Rate: %13.2f\n", $packcnt / $maxtime) if $maxtime; - print "\n"; - } diff --git a/scripts/support/bin/mvstats b/scripts/support/bin/mvstats deleted file mode 100644 index e33dc792..0000000 --- a/scripts/support/bin/mvstats +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# -# mvstats,v 3.1 1993/07/06 01:10:24 jbj Exp -# -# mvstats is called by cron for keeping the log files together -# usually only used on reference hosts -# -# Files reside in /var/NTP -# Files older than 2 days will be compressed, -# Files older than 64 days will be removed. -# -# mvstats,v -# Revision 3.1 1993/07/06 01:10:24 jbj -# XNTP release 3.1 -# -# -# Revision 1.1 1992/12/10 12:58:24 kardel -# Prerelease NTP V3 / DCF -# -# -cd /var/NTP -find . ! -name '*.Z' -mtime +2 -exec compress -f {} \; -find . -mtime +64 -exec rm -f {} \; diff --git a/scripts/support/conf/hp300.hp300 b/scripts/support/conf/hp300.hp300 deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/hp300.hp300 +++ /dev/null diff --git a/scripts/support/conf/hp700.hp700 b/scripts/support/conf/hp700.hp700 deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/hp700.hp700 +++ /dev/null diff --git a/scripts/support/conf/hp700.hp700.faui47 b/scripts/support/conf/hp700.hp700.faui47 deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/hp700.hp700.faui47 +++ /dev/null diff --git a/scripts/support/conf/hp800.hp800 b/scripts/support/conf/hp800.hp800 deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/hp800.hp800 +++ /dev/null diff --git a/scripts/support/conf/ntp.conf b/scripts/support/conf/ntp.conf deleted file mode 100644 index 2d6bb85..0000000 --- a/scripts/support/conf/ntp.conf +++ /dev/null @@ -1,3 +0,0 @@ -# -# put your default configuration (e.g. broadcastclient) in here -# diff --git a/scripts/support/conf/sun3.sun3 b/scripts/support/conf/sun3.sun3 deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/sun3.sun3 +++ /dev/null diff --git a/scripts/support/conf/sun4.sun4.faui01 b/scripts/support/conf/sun4.sun4.faui01 deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/sun4.sun4.faui01 +++ /dev/null diff --git a/scripts/support/conf/sun4.sun4.faui10 b/scripts/support/conf/sun4.sun4.faui10 deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/sun4.sun4.faui10 +++ /dev/null diff --git a/scripts/support/conf/sun4.sun4.faui45 b/scripts/support/conf/sun4.sun4.faui45 deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/sun4.sun4.faui45 +++ /dev/null diff --git a/scripts/support/conf/sun4.sun4c b/scripts/support/conf/sun4.sun4c deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/sun4.sun4c +++ /dev/null diff --git a/scripts/support/conf/sun4.sun4c.Lucifer b/scripts/support/conf/sun4.sun4c.Lucifer deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/sun4.sun4c.Lucifer +++ /dev/null diff --git a/scripts/support/conf/sun4.sun4m b/scripts/support/conf/sun4.sun4m deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/sun4.sun4m +++ /dev/null diff --git a/scripts/support/conf/sun4.sun4m.faui42 b/scripts/support/conf/sun4.sun4m.faui42 deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/sun4.sun4m.faui42 +++ /dev/null diff --git a/scripts/support/conf/sun4.sun4m.faui45m b/scripts/support/conf/sun4.sun4m.faui45m deleted file mode 100644 index e69de29..0000000 --- a/scripts/support/conf/sun4.sun4m.faui45m +++ /dev/null diff --git a/scripts/support/conf/tickconf b/scripts/support/conf/tickconf deleted file mode 100644 index b17dbe8..0000000 --- a/scripts/support/conf/tickconf +++ /dev/null @@ -1,19 +0,0 @@ -DEFAULT -A -p -s -q -Lucifer 55406cfa -a 1 -p -s -q -t 10001 -faui45 24000f9b -a 1 -p -s -q -faui10 2440213c -a 1 -p -s -q -faui1b 54001418 -A -p -s -q -t 10001 -faui4p 5100344d -A -p -s -q -t 9999 -faui02g 1200be20 -A -p -s -q -t 9999 -faui02e 1200bbab -A -p -s -q -t 9999 -faui02f 1200bedb -A -p -s -q -t 9999 -faui03b 1200b92b -A -p -s -q -t 9999 -faui45m 726001ac -A -p -s -q -t 10001 -faui45o 72600272 -A -p -s -q -t 10001 -faui45p 7260028f -A -p -s -q -t 10001 -faui45r 72400cc7 -A -p -s -q -t 10001 -faui45s 726045be -A -p -s -q -t 10001 -faui45v 72604487 -A -p -s -q -t 10001 -faui45x 726044eb -A -p -s -q -t 10001 -faui45y 7260476d -A -p -s -q -t 10001 -faui45z 726045a1 -A -p -s -q -t 10001 diff --git a/scripts/support/etc/cron b/scripts/support/etc/cron deleted file mode 100644 index 07ed189..0000000 --- a/scripts/support/etc/cron +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# cron,v 3.1 1993/07/06 01:10:50 jbj Exp -# -# called by cron for statistics gathering -# -# cron,v -# Revision 3.1 1993/07/06 01:10:50 jbj -# XNTP release 3.1 -# -# -# Revision 1.1 1992/12/10 12:59:18 kardel -# Prerelease NTP V3 / DCF -# -# -PATH="${PATH}:/local/NTP/bin" -export PATH -monl -d /local/NTP/monitor -i '127\.0\.0\.1' faui10 faui45 lucifer rackety.udel.edu diff --git a/scripts/support/etc/crontab b/scripts/support/etc/crontab deleted file mode 100644 index 2b2d19c..0000000 --- a/scripts/support/etc/crontab +++ /dev/null @@ -1,8 +0,0 @@ -# -# NTP statistics periodic cleanup - REFERENCE SERVER ONLY -# -#55 23 * * * sh /local/NTP/etc/mvstats -# -# gather NTP client statistics - REFERENCE SERVER ONLY -# -0 8,18 * * * /local/NTP/etc/cron 2>/dev/null | /usr/ucb/mail -s "NTP statistics" time@informatik.uni-erlangen.de diff --git a/scripts/support/etc/install b/scripts/support/etc/install deleted file mode 100644 index 169a7e5..0000000 --- a/scripts/support/etc/install +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh -# -# install,v 3.1 1993/07/06 01:10:53 jbj Exp -# -# install,v -# Revision 3.1 1993/07/06 01:10:53 jbj -# XNTP release 3.1 -# -# -# Revision 1.1 1992/12/10 12:59:21 kardel -# Prerelease NTP V3 / DCF -# -# Revision 1.1 1992/06/18 14:50:08 kardel -# Initial revision -# -# -NTPROOT=/local/NTP # SITE SPECIFIC: where NTP resides -# -# where the local NTP state files reside (xntp.drift) ussualle /etc -# this directory must not be shared as machine dependent data ist stored there -# -NTPDIR="/+private/local/NTP" -# -# get the initial setup -# -if [ ! -r $NTPROOT/etc/setup ]; then - echo "ERROR: $NTPROOT/etc/setup missing - incorrect installation." - exit 1 -else - . $NTPROOT/etc/setup -fi - -umask 022 # SITE SPECIFIC: local policy - watch out for NFS and "root" rights - -Mkdir() { - p="" - IFS="/" - set -- $@ - IFS=' -' - for pnc do - if [ ! -d "$p/$pnc" ]; then - ECHO -n "creating directory $p/$pnc" - if mkdir "$p/$pnc"; then - ECHO "" - else - ECHO " - FAILED" - break; - fi - fi - p="$p/$pnc" - done -} - -if [ ! -d "$NTPDIR" ]; then - ECHO "installing NTP private data area ($NTPDIR)" - if Mkdir "$NTPDIR"; then - chmod 755 "$NTPDIR" - ECHO "$NTPDIR created." - fi -else - ECHO "NTP already installed." - if [ -f "$NTPDIR/xntp.drift" ]; then - ECHO "currently saved drift value:" `cat "$NTPDIR/xntp.drift"` - fi -fi - diff --git a/scripts/support/etc/rc b/scripts/support/etc/rc deleted file mode 100644 index ef8834a..0000000 --- a/scripts/support/etc/rc +++ /dev/null @@ -1,198 +0,0 @@ -#!/bin/sh -# NTP time synchronisation -# -# /src/NTP/REPOSITORY/v3/supportscripts/etc/rc,v 1.11 1993/07/09 13:17:00 kardel Exp -# -# rc,v -# Revision 1.11 1993/07/09 13:17:00 kardel -# local NTPROOT -# -# Revision 1.10 1993/07/09 11:37:29 kardel -# Initial restructured version + GPS support -# -# Revision 1.9 1993/06/23 14:10:36 kardel -# June 21st reconcilation -# -# Revision 1.7 1993/06/02 12:04:43 kardel -# May 28th reconcilation & clenaup -# -# -# non reference clock hosts will try to do an ntpdate on NTPSERVERS -# -NTPSERVERS="ntps1-0 ntps1-1 ntps2-0 ntps2-1" -NTPROOT=/local/NTP - -# -# get the initial setup -# -if [ ! -r $NTPROOT/etc/setup ]; then - echo "ERROR: $NTPROOT/etc/setup missing - incorrect installation." - exit 1 -else - . $NTPROOT/etc/setup -fi - -umask 022 # SITE SPECIFIC: local policy - watch out for NFS and "root" rights - -msg="" -# -# default configuration files are named $NTPROOT/conf/<ARCH>.<KARCH> -# -CF=$NTPROOT/conf/$ARCH.$KARCH # default configuration file -# -# Host specific config file (reference clocks) have the hostname tagged on -# -CFH="$CF"."$HOSTNAME" # specific configuration file -# -# where to find the tickadj command -# -KFIX=$NTPROOT/bin/tickadj # kernel variable fix -# -# where to find special tickadj parameters -# -TC=$NTPROOT/conf/tickconf # special tickadj parameters -# -# where to find the keys file (if not found $KEY.dumb will be used) -# -KEY=$NTPROOT/conf/ntp.keys # private key file -# -# the daemon -# -XD=$NTPROOT/bin/xntpd # NTP daemon -# -# HP adjtimed -# -ADJTIMED=$NTPROOT/bin/adjtimed # HP special (adjtime() emulation) -# -# ntpdate command -# -NTPDATE=$NTPROOT/bin/ntpdate - -# -# secondary timed support -# The word "TIMED" must be in the config file for timed to start -# Note that this times is a special version which does not ever set or -# adjust the time. Ask time@informatik.uni-erlangen.de for patches -# -TIMED=$NTPROOT/bin/timed # timed (Berkeley) secondary time service - # here used in a *HARMLESS* version - # to provide time to "inferior" systems -# -# ISREFHOST is a command that returns exit status 0 for a reference host -# Site specific: sample for dcf77 is given -# -ISREFHOST="[ -f $NTPROOT/.karch.$KARCH/sys/OBJ/parsestreams.o -a -f /dev/refclock-0 ]" -# -# SETUP_REFCLOCK -# -# what to do in order to set up a local reference clock -# usually this will load a STREAMS module or initialize other things -# needed -# -SETUP_REFCLOCK() { - if modstat | grep -s 'PARSE'; then - ECHO "loadable PARSER STREAMS module already loaded." - else - ECHO "attempting to load PARSER STREAMS module..." - MDLFILE="/tmp/mdl.$$" - if modload $NTPROOT/.karch.$KARCH/sys/OBJ/parsestreams.o -o $MDLFILE 2>&1; then - modstat - else - echo WARNING: load FAILED - fi | LOG - rm -f $MDLFILE - unset MDLFILE - fi -} - -kargs() { - MATCH=NO - HOSTID="`(hostid) 2>/dev/null || echo 000000`" - if [ -r "$TC" ]; then - exec 0< "$TC" - while [ "$MATCH" != "YES" ] && read HOST ID PARAM; do - if [ "$HOST" = "DEFAULT" ]; then - DEFAULT="$ID $PARAM" - else - if [ "$ID" = "$HOSTID" -o "$HOST" = "$HOSTNAME" ]; then - echo "$PARAM" - MATCH=YES - fi - fi - done - if [ "$MATCH" != "YES" ]; then - if [ -z "$DEFAULT" ]; then - echo "-A -p -s -q"; - else - echo "$DEFAULT"; - fi - fi - else - echo "-A -p -s -q"; - fi -} - -if [ -x $XD ]; then - if [ -x "$ADJTIMED" ]; then - $ADJTIMED && ECHO "adjusttimesupport: adjtimed." - fi - # - # WARNING: check ps command first, or you might kill things you don't want to - # - PID="`(ps -efa 2>/dev/null || ps auxww 2>/dev/null || echo "") | grep xntp | grep -v grep | awk '{ print $2 }'`" - - if [ ! -z "$PID" ]; then - ECHO "killing old NTP daemon (PID=$PID)" - # - # enable this after checking for correctness - # kill $PID - ECHO "should do a kill $PID, if this is the right PID - check rc script" - fi - # - # try an ntpdate when timeservers are configured - # - if [ ! -z "$NTPSERVERS" -a -x $NTPDATE ]; then - ECHO "NTP initial time setting" - $NTPDATE -v $NTPSERVERS | LOG - fi - # - # look for reference clock equipment - # - if $ISREFHOST; then - ECHO "REFERENCE CLOCK SUPPORT (initializing...)" - SETUP_REFCLOCK - fi - - if [ -r "$CFH" ]; then - CF="$CFH" - else - if [ ! -r "$KEY" ]; then - KEY="$KEY.dumb" - fi - fi - - ECHO "NTP configuration file: $CF" - ECHO -n "time daemon startup:" - - if [ -r "$CF" ]; then - if [ -x "$KFIX" ]; then - KARGS="`kargs`" - if [ ! -z "$KARGS" ]; then - $KFIX $KARGS && ECHO -n "tickadj $KARGS" - fi - fi - $XD -c "$CF" -k "$KEY" && ECHO -n ' xntpd' - if [ -x "$TIMED" ] && grep -s TIMED "$CF"; then - $TIMED -M -N && ECHO -n ' timed' - fi - else - msg="configuration file ($CF) not present." - fi -else - msg="daemon binary ($XD) not present." -fi -ECHO "." - -if [ "$msg" ]; then - NLECHO "WARNING: NO NTP time sychronisation: $msg" -fi diff --git a/scripts/support/etc/setup b/scripts/support/etc/setup deleted file mode 100644 index d4ea75e..0000000 --- a/scripts/support/etc/setup +++ /dev/null @@ -1,72 +0,0 @@ -# -# setup,v 3.1 1993/07/06 01:10:55 jbj Exp -# -# /bin/sh sourced file for environment setup -# expects NTPROOT variable initialized -# -# if not set it will be initialized to /usr/local/NTP -# -# setup,v -# Revision 3.1 1993/07/06 01:10:55 jbj -# XNTP release 3.1 -# -# -# Revision 1.1 1992/12/10 12:59:25 kardel -# Prerelease NTP V3 / DCF -# -# Revision 1.1 1992/12/10 10:14:46 kardel -# Initial revision -# -# -NTPROOT=${NTPROOT-/usr/local/NTP} - -# -# we so use our own echos, as we somes want to substitute them with a -# file logging version durin the /etc/rc.local phase -# -set `type ECHO` - -PATH="${PATH}:$NTPROOT/bin" -export PATH - -if [ "$2" = "is" ]; then - : -else - # - # find out the way echos work (Rest of rc thinks BSD echo) - # - ECHOREP="`echo -n x`" - if [ "$ECHOREP" = "-n x" ]; then - ECHO () { - if [ "$1" = "-n" ]; then - shift - echo "$@\c" - else - echo "$@" - fi - } - #ECHO "System V style echo" - else - ECHO () { - echo "$@" - } - #ECHO "BSD style echo" - fi - - NLECHO () { - echo "$@" - } - - LOG () { - while read _line; do - ECHO "$_line" - done - } - # - # carefully find out some configuration Variables - # - ARCH="`(arch) 2>/dev/null || ((uname) > /dev/null && uname -a | awk '{ print $6; }') 2>/dev/null || echo 'no-arch'`" - KARCH="`(arch -k) 2>/dev/null || ((uname) > /dev/null && uname -a | awk '{ print $5 }') || echo 'no-arch'`" - HOSTNAME="`(hostname) 2>/dev/null || uname -n`" -fi - |