fix: cp205
This commit is contained in:
@@ -1,16 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
git_root_dir=$(dirname $(dirname $(dirname $(realpath $0))))
|
git_root_dir=$(dirname $(realpath $0)/../../..)
|
||||||
build_root_dir=${git_root_dir}/build.wfc
|
build_root_dir=${git_root_dir}/build.wfc
|
||||||
build_doc_dir=${build_root_dir}/docs/03-configuration
|
build_doc_dir=${build_root_dir}/docs/03-configuration
|
||||||
local_tars_rel_dir=${build_root_dir}/release/tars
|
local_tars_rel_dir=${build_root_dir}/release/tars
|
||||||
tars_rel_dir_205=/mnt/public/release/omc/wfc/tars/
|
local_debs_rel_dir=${build_root_dir}/release/debs
|
||||||
|
wfc_rel_dir_205=/mnt/public/release/omc/wfc
|
||||||
|
tars_rel_dir_205=${wfc_rel_dir_205}/tars/
|
||||||
|
debs_rel_dir_205=${wfc_rel_dir_205}/debs/
|
||||||
server_ip_205=192.168.1.205
|
server_ip_205=192.168.1.205
|
||||||
rel_date=$(date +%Y%m%d)
|
rel_date=$(date +%Y%m%d)
|
||||||
passwd=admin123
|
passwd=admin123
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: sh cpto205.sh {rel_date}"
|
echo "Usage: sh cpto205.sh {rel_date} (format: YYYYMMDD)"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,16 +22,19 @@ if [ ! -z "$1" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
quickstart_file=${build_doc_dir}/03-wfc-quickstart.pdf
|
quickstart_file=${build_doc_dir}/03-wfc-quickstart.pdf
|
||||||
latest_file=$(ls -t ${local_tars_rel_dir}/*${rel_date}* 2>/dev/null | head -n 1)
|
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)
|
||||||
|
|
||||||
# 使用expect自动回答yes和输入密码
|
# Use expect to automatically answer yes and input password
|
||||||
expect <<EOF
|
expect <<EOF
|
||||||
set timeout 120
|
set timeout 120
|
||||||
spawn scp ${latest_file} ${quickstart_file} agtuser@${server_ip_205}:${tars_rel_dir_205}
|
spawn scp ${latest_tar_file} agtuser@${server_ip_205}:${tars_rel_dir_205}
|
||||||
expect {
|
expect {
|
||||||
"yes/no" { send "yes\n"; exp_continue }
|
"yes/no" { send "yes\n"; exp_continue }
|
||||||
"password:" { send "$passwd\n" }
|
"password:" { send "$passwd\n" }
|
||||||
}
|
}
|
||||||
|
spawn scp ${latest_deb_file} agtuser@${server_ip_205}:${debs_rel_dir_205}
|
||||||
|
spawn scp ${quickstart_file} agtuser@${server_ip_205}:${wfc_rel_dir_205}
|
||||||
expect eof
|
expect eof
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user