#!/bin/sh # # ntpman.sh -- Create man pages for ntp # Configuration parameters VERSION=4.2.0-r2 HTMLDIR=/usr/doc/ntp-$VERSION/html MANDIR=. # Process a single HTML file processfile() { HTMLFILE=$1 MANFILE=$2 TMPFILE=/tmp/ntpman.tmp echo -n "Processing $HTMLFILE..." cat $HTMLDIR/$HTMLFILE | sed -e "s///" -e "s/ / /" -e "s/\\\/\//" > $TMPFILE xsltproc --html --stringparam version $VERSION ntp.xsl $TMPFILE | gzip > $MANDIR/$MANFILE rm $TMPFILE echo "Done." } # Print information echo "Generates ntp man files from HTML documentation. Using:" echo "VERSION: $VERSION" echo "HTMLDIR: $HTMLDIR" echo "MANDIR: $MANDIR" echo "Press enter to continue, or Ctrl-C to cancel." read # Process HTML files processfile ntpd.html ntpd.1.gz processfile ntpq.html ntpq.1.gz processfile ntpdc.html ntpdc.1.gz processfile ntpdate.html ntpdate.1.gz processfile ntptrace.html ntptrace.1.gz processfile tickadj.html tickadj.1.gz processfile ntptime.html ntptime.1.gz processfile keygen.html ntp-genkeys.1.gz processfile ntpdsim.html ntpdsim.1.gz