#!/bin/sh

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

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

cd $HOME/hobbit || exit 1

for DIR in bbdisplay bbnet bbproxy common hobbitd 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\" \"Hobbit Monitor\""; tail +2 $f) >$f.new
      mv $f.new $f
      ci -u -m"Version update" -q -f $f
   done

   popd
done

