svn调用脚本(三)

#!/bin/bash

#example:
#usrname='svnuser'
#passwd='svnpassword'
#svn_link="http://url/svn_dir"
#svn_dir="target_dir"

usrname=$1
passwd=$2
svn_link=$3
svn_dir=$4
svn_flag=".svn"

cmd=$(rpm -qa|grep "expect")
if [ $? -ne 0 ];then
        yum -y install expect
fi

cd ${svn_dir}

if [ -d ${svn_flag} ]&&[ "x${svn_link}" != "x" ] 
then
/usr/bin/expect   <<-EOF
set timeout 120
spawn svn co ${svn_link} . --username ${usrname} --password ${passwd}
expect {
        "*(yes/no)?*" { send "yes\r";exp_continue ;}
 }
EOF
else
/usr/bin/expect   <<-EOF
set timeout 120
spawn svn update
expect {
        "*Password for 'admin':*" { send "${passwd}\r";exp_continue }
        "*(yes/no)?*" { send "yes\r";exp_continue ;}
 }
EOF
fi

网页名称:svn调用脚本(三)
本文URL:http://hzjierui.cn/article/ppcghg.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款