首页 > 代码库 > svn添加用户shell
svn添加用户shell
#!/bin/bash adduser(){ echo "Copy authz File authz to `date "+%Y%m%d%s"`"&&cp authz authz`date "+%Y%m%d%s"` # more authz | grep ^[A-Z] | grep $DP | sed ‘s/$/&,‘$USER‘/g‘ > authz.new sed -i ‘/^‘$DP‘/s/$/,‘$USER‘/‘ authz } process(){ if [ "$DP" != "" ] then for i in `more authz | grep "$DP =" | grep -v @ | awk ‘{print $3}‘ | tr "," "\n"` do more passwd | grep $i > /dev/null 2>&1 if [ $? = 1 ]; then echo "Copy passwd File to passwd`date "+%Y%m%d%s"`"&&cp passwd passwd`date "+%Y%m%d%s"` sed -i ‘/‘$DP‘/a\‘$i‘ = ‘$i‘@emoney‘ passwd more passwd | grep $i > /dev/null 2>&1 if [ $? = 0 ]; then echo "User $i Add Succes" else echo "User $i Add Flase" fi fi done else echo "Department ID not set" fi } read -p "Please Input New UserName:" USER read -p "Please Input Department ID:" DP case $DP in Market_SEM) adduser sleep 1 process ;; Market_UE) adduser sleep 1 process ;; JSB_JG) adduser sleep 1 process ;; JSB_OP) adduser sleep 1 process ;; Market_PD) adduser sleep 1 process ;; Market_mk2) adduser sleep 1 process ;; Market_PR) adduser sleep 1 process ;; *) if [ "$DP" = "" ] then echo "Department ID not set" else echo -e "Department Mistake\n#####Detail List######\nMarket_SEM\nMarket_UE\nJSB_JG\nJSB_OP\nMarket_PD\nMar ket_mk2\nMarket_PR\n#####Detail List######" fi ;; esac
svn添加用户shell
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。