S2OJ/install/bundle/new_problem.sh
MascoSkray c5ef73dc76
style: move install files to a renamed folder
The installation files are dirty when they are outside of the folder. It now looks not so mess.
And there is no need to place empty jdk files. 果断删除之。
2017-09-07 13:16:13 +08:00

35 lines
606 B
Bash

if [ $# -ne 1 ]
then
echo 'invalid argument'
exit 1
fi
path=/var/svn/problem/$1
mkdir $path
svnadmin create $path
cat >$path/conf/svnserve.conf <<EOD
[general]
anon-access = none
auth-access = write
password-db = passwd
EOD
svnusr="our-root"
svnpwd="__our_root_password__"
cat >$path/conf/passwd <<EOD
[users]
$svnusr = $svnpwd
EOD
mkdir $path/cur
cd $path/cur
svn checkout svn://127.0.0.1/problem/$1 --username $svnusr --password $svnpwd
mkdir /var/uoj_data/$1
cat >$path/hooks/post-commit <<EODEOD
#!/bin/sh
/var/svn/problem/post-commit.sh $1
EODEOD
chmod +x $path/hooks/post-commit