您的位置:軟件測試 > 開源軟件測試 > 開源配置管理工具 > cvs
CVS管理腳本
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2013/1/18 13:49:31 ] 推薦標簽:


  if [ -z $1 ]; then
  
  echo "Usage: $0 [cvsuser] [system user] [password]"
  
  echo " $0 chen cvs 123456"
  
  exit 0
  
  else
  
  # echo $CVSUSER , $SYSUSER , $CVSPASS
  
  isExists=`grep -c "$CVSUSER>" $CVSROOT/passwd`
  
  # echo $isExists
  
  if [ "$isExists" = "0" ]; then
  
  cvsadduser
  
  else
  
  echo "$0 : user $1 exists"
  
  exit 0
  
  fi
  
  fi
  
  [root@linux cvs]#
  
  3. 刪除用戶程序源碼
  
  [root@linux cvs]# cat cvsuserdel
  
  #!/bin/sh
  
  ##############################################################
  
  # Script to cvs passwd
  
  # File:/root/admintool
  
  ##############################################################
  
  # Setup environment for script execution
  
  ENVS="`pwd`"/envs
  
  if [ -f $ENVS ]; then
  
  . $ENVS
  
  else
  
  CVSROOT=/cvsroot/CVSROOT
  
  CVSUSER=$1
  
  # echo "The file exist."
  
  # exit 0
  
  fi
  
  cvsuserdel() {
  
  isExists=`gawk -F: '$1=="'$CVSUSER'"{print $1}' $CVSROOT/passwd`
  
  if [ "$CVSUSER" = "$isExists" ]; then
  
  DLINE=`grep -n "$CVSUSER>" $CVSROOT/passwd|gawk -F: '{print $1}'`
  
  mv -f $CVSROOT/passwd $CVSROOT/passwd.old
  
  sed $DLINE'd' $CVSROOT/passwd.old>>$CVSROOT/passwd
  
  else
  
  echo "$0 : user $CVSUSER does not exist"
  
  fi
  
  }
  
  if [ -z $1 ]; then
  
  echo "Usage: $0 [cvsuser] [newpassword] "
  
  echo " $0 chen 123456"
  
  exit 0
  
  else
  
  cvsuserdel
  
  exit 1
  
  fi
  
  [root@linux cvs]#

上一頁1234下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd