下文来为各位总结一下Linux下Shell脚本完成SVN版本库的建立例子,有需要了解的朋友可参考一下,每次建立一个新的SVN版本库总感觉很繁琐,所以写了段脚本来把这个过程自动化,详细代码如下:
- #!/bin/bash
- # by www.Vevb.com
- echo -n "Enter SVN name :"
- read svn_name
- /usr/bin/svnadmin create /svnroot/$svn_name
- if [ $? -eq 0 ]; then
- # svnserve.conf
- sed -i 's/# anon-access = read/anon-access = none/g' /svnroot/$svn_name/conf/svnserve.conf
- sed -i 's/# auth-access = write/auth-access = write/g' /svnroot/$svn_name/conf/svnserve.conf
- sed -i 's/# password-db = passwd/password-db = \/svnroot\/conf\/passwd/g' /svnroot/$svn_name/conf/svnserve.conf
- sed -i 's/# authz-db = authz/authz-db = authz/g' /svnroot/$svn_name/conf/svnserve.conf
- # authz
- cat > /svnroot/$svn_name/conf/authz<<EOF
- [groups]
- developer = jason
- [/]
- @developer = rw
- EOF
- fi
新闻热点
疑难解答