ソースを参照

make path first, in case the part doesn't exist.

make path first, in case the part doesn't exist.
neil 10 年 前
コミット
3bf6a399a5
1 ファイル変更4 行追加2 行削除
  1. 4 2
      bin/v-add-backup-host

+ 4 - 2
bin/v-add-backup-host

@@ -137,8 +137,10 @@ if [ "$type" = 'sftp' ]; then
     if [ -z $port ]; then
         port=22
     fi
-    sftmpdir="$path/vst.bK76A9SUkt"
-    sftpc "mkdir $sftmpdir" "rmdir $sftmpdir" > /dev/null 2>&1
+    if sftpc "mkdir $path" > /dev/null 2>&1 ; then
+        sftmpdir="$path/vst.bK76A9SUkt"
+        sftpc "mkdir $sftmpdir" "rmdir $sftmpdir" > /dev/null 2>&1
+    fi
     rc=$?
     if [[ "$rc" != 0 ]]; then
         case $rc in