From dd37d774844ee36bb370fdf8c790c4046945f160 Mon Sep 17 00:00:00 2001 From: saarloos <9090-90-90-9090@163.com> Date: Thu, 16 Jun 2022 10:01:31 +0800 Subject: [PATCH] creat dir in remote --- script/tools/copy_embedded_img.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script/tools/copy_embedded_img.sh b/script/tools/copy_embedded_img.sh index f5a4e52..1639794 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 -- Gitee