Explorar el Código

Merge pull request #683 from Neilpang/master

make path first, in case the part doesn't exist.
Serghey Rodin hace 9 años
padre
commit
1db2592831
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  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