Skip to content

Commit 3bf6a39

Browse files
author
neil
committed
make path first, in case the part doesn't exist.
make path first, in case the part doesn't exist.
1 parent 5e861eb commit 3bf6a39

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/v-add-backup-host

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ if [ "$type" = 'sftp' ]; then
137137
if [ -z $port ]; then
138138
port=22
139139
fi
140-
sftmpdir="$path/vst.bK76A9SUkt"
141-
sftpc "mkdir $sftmpdir" "rmdir $sftmpdir" > /dev/null 2>&1
140+
if sftpc "mkdir $path" > /dev/null 2>&1 ; then
141+
sftmpdir="$path/vst.bK76A9SUkt"
142+
sftpc "mkdir $sftmpdir" "rmdir $sftmpdir" > /dev/null 2>&1
143+
fi
142144
rc=$?
143145
if [[ "$rc" != 0 ]]; then
144146
case $rc in

0 commit comments

Comments
 (0)