fix: cp use rsync
This commit is contained in:
@@ -26,11 +26,12 @@ quickstart_file=${build_doc_dir}/03-WANFi软件快速安装.pdf
|
||||
latest_tar_file=$(ls -t ${local_tars_rel_dir}/*${rel_date}* 2>/dev/null | head -n 1)
|
||||
latest_deb_file=$(ls -t ${local_debs_rel_dir}/*${rel_date}* 2>/dev/null | head -n 1)
|
||||
|
||||
# Use expect to automatically answer yes and input password for SCP commands
|
||||
# Use expect to automatically answer yes and input password for rsync commands
|
||||
|
||||
if [ -n "${latest_deb_file}" ]; then
|
||||
expect <<EOF
|
||||
spawn scp ${latest_deb_file} agtuser@${server_ip_205}:${debs_rel_dir_205}
|
||||
set timeout -1
|
||||
spawn rsync -avz ${latest_deb_file} agtuser@${server_ip_205}:${debs_rel_dir_205}
|
||||
expect {
|
||||
"yes/no" {
|
||||
send "yes\n"
|
||||
@@ -44,7 +45,8 @@ fi
|
||||
|
||||
if [ -n "${latest_tar_file}" ]; then
|
||||
expect <<EOF
|
||||
spawn scp ${latest_tar_file} agtuser@${server_ip_205}:${tars_rel_dir_205}
|
||||
set timeout -1
|
||||
spawn rsync -avz ${latest_tar_file} agtuser@${server_ip_205}:${tars_rel_dir_205}
|
||||
expect {
|
||||
"yes/no" {
|
||||
send "yes\n"
|
||||
@@ -58,7 +60,8 @@ fi
|
||||
|
||||
if [ -f "${quickstart_file}" ]; then
|
||||
expect <<EOF
|
||||
spawn scp ${quickstart_file} agtuser@${server_ip_205}:${wfc_rel_dir_205}
|
||||
set timeout -1
|
||||
spawn rsync -avz ${quickstart_file} agtuser@${server_ip_205}:${wfc_rel_dir_205}
|
||||
expect {
|
||||
"yes/no" {
|
||||
send "yes\n"
|
||||
|
||||
Reference in New Issue
Block a user