Linux method of creating SVN repository through shell scripts

  

Linux is very troublesome to build SVN repository every time. If you implement these through shell scripts, it will be much simpler. How to compile this shell script? The following small series will introduce you to the way Linux uses the shell script to create the SVN repository.

Every time build a new SVN repository always feel very cumbersome, so added a script to automate this process, the detailed code is as follows:

#! /bin/bash

# by www.111cn.net

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

The above is a description of how Linux uses shell scripts to build SVN repositories. If you are tired of manually creating SVN repositories again and again, you can quickly implement them through shell scripts.

Copyright © Windows knowledge All Rights Reserved