svn 添加用户 随机密码

阅读更多
#!/bin/bash
[ $# -lt 1 ] && echo "add user must add useraccount" && exit;
ACCOUNT=$1
PASSWORD=`cat /dev/urandom |  base64|head -c 12`
PASSWORD=${PASSWORD//\//X}
PASSWORD=${PASSWORD//\+/j}
/usr/bin/htpasswd -b /data/svn/project/conf/httppasswd $ACCOUNT $PASSWORD
echo  $ACCOUNT" = "$PASSWORD >>passwd
echo "Http Access: http://url/"
echo "SVN Base: svn://url"
echo "Account: "$ACCOUNT
echo "Password: "$PASSWORD

 

你可能感兴趣的:(shell,随机密码,svn,htpasswd)