feat: add copy sh to 205
This commit is contained in:
34
bin/cpto205.sh
Normal file
34
bin/cpto205.sh
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
git_root_dir=${HOME}/wfc.git
|
||||||
|
build_root_dir=${git_root_dir}/build.wfc
|
||||||
|
build_doc_dir=${build_root_dir}/docs/03-configuration
|
||||||
|
local_tars_rel_dir=${build_root_dir}/release/tars
|
||||||
|
tars_rel_dir_205=/mnt/public/release/omc/wfc/tars/
|
||||||
|
server_ip_205=192.168.1.205
|
||||||
|
rel_date=$(date +%Y%m%d)
|
||||||
|
passwd=admin123
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: sh cpto205.sh {rel_date}"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ ! -z "$1" ]; then
|
||||||
|
rel_date=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
# 使用expect自动回答yes和输入密码
|
||||||
|
expect <<EOF
|
||||||
|
set timeout 120
|
||||||
|
spawn scp ${latest_file} ${quickstart_file} agtuser@${server_ip_205}:${tars_rel_dir_205}
|
||||||
|
expect {
|
||||||
|
"yes/no" { send "yes\n"; exp_continue }
|
||||||
|
"password:" { send "$passwd\n" }
|
||||||
|
}
|
||||||
|
expect eof
|
||||||
|
EOF
|
||||||
|
|
||||||
Reference in New Issue
Block a user