#! /bin/sh
echo
echo "CVS/Root update-script version 1.0"
echo "me at freax dot org <Philip Van Hoof>"
echo "http://www.freax.eu.org"
echo
echo "After running this script all files named */CVS/Root will the modified"
echo "CVSROOT that will be used: $CVSROOT"
echo
echo -en "Are you sure ? [Yes/No] "
read YESNO

if test $YESNO = "Yes"; then
 echo
 echo "Going into ."
 echo -en "\tUpdating ./CVS/Root\n"
 echo $CVSROOT > CVS/Root

 for i in *
 do
 if test -d "$i"; then
  echo "Going into $i"
  cd "$i"
  for y in *
  do
    if test "CVS" = "$y"; then
     cd CVS
     echo -en "\tUpdating ./$i/$y/Root\n"
     echo $CVSROOT > Root
     cd ..
    fi
  done
  cd ..
 fi
 done

 echo
 echo "All done"
 echo

else
 echo "Okay, bye then"
fi
