一个工作需要重复5次以上,那就写个脚本吧.
一、删除一个svn用户
#----------------------------引用文字-开始----------------------------
#!/bin/bash
#Delect a svn user
#Author:楚霏
echo -n " Please enter the user name whom you want to delete : "
read NAME
#把下边这行的 "/home/svnroot/" 改为你的svn根目录
SVNROOT=/home/svnroot
#delect the name in authz
for i in `ls $SVNROOT/repository/`; do sed -i "s/$NAME\,//g" "$SVNROOT/repository/${i}/conf/authz"; done
for i in `ls $SVNROOT/repository/`; do sed -i "s/$NAME//g" "SVNROOT/repository/${i}/conf/authz"; done
#delcet the information in passwd
for i in `ls $SVNROOT/repository/`; do sed -i "/$NAME/d" "SVNROOT/repository/${i}/conf/passwd"; done
#check
grep -R $NAME $SVNROOT/repository/*/conf/*
#----------------------------引用文字-结束----------------------------
二、更改svn用户的密码
#----------------------------引用文字-开始----------------------------
#!/bin/bash
#Change a svn user's passwd
#Author:楚霏
echo -n " Please enter the username : "
read NAME
echo -n "New password: "
read PASSWD
#delect the name in authz
#把下边这行的 "/home/svnroot/" 改为你的svn根目录
SVNROOT=/home/svnroot
for i in `ls $SVNROOT/repository/`; do sed -i "s/^$NAME.*/$NAME = $PASSWD/g" "$SVNROOT/repository/${i}/conf/passwd"; done
echo "done"
#----------------------------引用文字-结束----------------------------
文章资源来自:
阅读(724) | 评论(0) | 转发(0) |