Svn automatically generates and easily configures the repository and restart the service script

Source: Internet
Author: User


Svn automatically generates and easily configures repository and restarts the service script www.2cto.com [ruby] #! /Bin/bash conf =/conf/svnserve. conf pw =/conf/passwd changeConf () {sed-I's \ # anon-access = read \ anon-accss = none \ G' "$1" $ {conf} sed-I's \ # auth-access = write \ auth-accss = write \ G' "$1" $ {conf} sed-I's \ # password-db = passwd \ G' "$1" $ {conf} addUser () {sed-I "s/# sally = sallyssecret/$2 = $3/g" "$1" $ {pw} if [$ #-lt 1]; then echo "Error param no .! "Echo" Usage (Root needed): svn. sh create reponame \ nOR svn. sh restart "exit fi if [" $1 "=" create "]; then if [-z" $2 "]; then echo "Error param" exit fi home =/home/repo =$ {home} "$2" echo "creating repo" $ repo svnadmin create $ repo if [$? -Ne 0]; then echo create failed! Exit; else read-p "inpute the username:" username read-p "inpute the password: "password changeConf $ repo addUser $ repo $ username $ password fi elif [" $1 "=" restart "]; then if [-z" $2 "]; then read-p "Listen on which ip: "ip fi pid = 'ps-e | grep svnserve | awk '{print $1} ''kill-9 $ pid 2>/dev/null 1> & 2 svnserve-d -r/home -- listen-host $ ip else echo "error param" fi

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.