diff --git a/script/tools/copy_embedded_img.sh b/script/tools/copy_embedded_img.sh index f5a4e5288d4b3b115521619c7eaaed4c764d41f3..163979411c7485fe1462c77f2fe3cde519b4d80f 100644 --- a/script/tools/copy_embedded_img.sh +++ b/script/tools/copy_embedded_img.sh @@ -1,6 +1,6 @@ #!/bin/bash -#Usage: bash copy_embedded_img.sh source_user source_ip source_pwd source_dir daily_ip ssh_key latest_iso_dir +#Usage: bash copy_embedded_img.sh source_user source_ip source_pwd source_dir daily_ip ssh_key latest_iso_dir function cp_embedded_img() { @@ -13,6 +13,9 @@ function cp_embedded_img() latest_iso_dir=$7 local copydir="${source_dir}" res=$(ssh -i ${ssh_key} -o StrictHostKeyChecking=no -o LogLevel=ERROR -o ServerAliveInterval=60 root@${dest_ip} " +if [ ! -e ${latest_iso_dir} ]; then + mkdir -p ${latest_iso_dir} +fi cd ${latest_iso_dir} if [ ! -d embedded_img ];then mkdir embedded_img