#!/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
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。