#!/bin/sh # if no arguments, print out help screen if test $# -lt 2; then echo "usage:" echo " cvscreate.sh [repositoryname] [initialusername] " echo "" exit 1 fi # make sure this repository doesn't already exist if [ -d /var/cvs/$1 ] ; then echo "$1 already exists." echo "" exit 1 fi # first create the repository mkdir /var/cvs/$1 cvs -d/var/cvs/$1 init # touch history file to get things started touch /var/cvs/$1/CVSROOT/history # copy over some stuff from the prototype repository cp /var/cvs/prototype/CVSROOT/loginfo* \ /var/cvs/prototype/CVSROOT/readers* \ /var/cvs/prototype/CVSROOT/passwd* \ /var/cvs/prototype/CVSROOT/config* \ /var/cvs/prototype/CVSROOT/cvswrappers* \ /var/cvs/prototype/CVSROOT/writers* \ /var/cvs/$1/CVSROOT/ # make it group writable chmod -R 775 /var/cvs/$1 # set group ownership chown -R $2:$1 /var/cvs/$1 # set sticky bit chmod -R g+s /var/cvs/$1 # history file should be 777 chmod 777 /var/cvs/$1/CVSROOT/history