Home VCS SVN
TEST - Some code messed up during site conversion 

#!/bin/sh

REPOHOME=/home/Repositories
REPOHOST=http://myserver/Repositories

if [[ "" == "$1" ]]; then
    echo "Missing new SVN name:"
    echo " $0 <svn name> <repo name>"

    exit 1
fi

if [[ "" == "$2" ]]; then
    echo "Missing new SVN name:"
    echo " $0 \"$1\" <repo name>"

    exit 1
fi

REPO=$REPOHOME/$1

cd $REPOHOME
svnadmin create "$1" || exit 1
chown -R www-data:www-data $REPO

TMP=/tmp/$$/
mkdir -p $TMP || exit 1

OLDDIR=`pwd`

cd $TMP
svn co $REPOHOST/$1 svn
cd svn
mkdir tags
mkdir branches
mkdir trunk

svn add *
svn commit -m 'Initial SVN Commit by script (pid = $$)'

cd $OLDDIR
rm -rf $TMP

cat <<EOM >$REPO/hooks/post-commit
#!/bin/sh
#Post-Commit Script
export LANG=en_CA.UTF-8
export REPONAME="$2"
export REV="\$2"
export REPOS="\$1"

. /home/Repositories/_hooks/post-commit

EOM

chmod +x $REPO/hooks/post-commit
chown -R www-data:www-data $REPO

cd /home/www/trunk
svn co $REPOHOST/$1/trunk $2
chown -R www-data:www-data /home/www/trunk/$2