#!/bin/bash

export LANG=C 
DATE=`date +"%e %b %Y"`
VERSION=$1

if [ "$VERSION" = "" ]
then
	echo "Usage: $0 VERSION"
	exit 1
fi

# cd $HOME/xymon || exit 1

for DIR in xymongen xymonnet xymonproxy common xymond web
do
   pushd $DIR

   # co -l RCS/*.[1-9],v
   for f in *.[1-9]
   do
      NAME=`head -n 1 $f | awk '{print $2}'`;
      SECTION=`head -n 1 $f | awk '{print $3}'`;
      (echo ".TH $NAME $SECTION \"Version $VERSION: $DATE\" \"Xymon\""; tail -n +2 $f) >$f.new
      mv -f $f.new $f
      # ci -u -m"Version update" -q -f $f
   done

   popd
done

