Better fix for FTP backup without folder name

This commit is contained in:
dpeca 2017-04-22 02:22:23 +02:00
parent 335b5fe41e
commit e022c6507b
2 changed files with 27 additions and 11 deletions

View file

@ -122,8 +122,12 @@ if [ "$type" = 'ftp' ]; then
fi
# Checking write permissions
ftpc "mkdir $path" > /dev/null 2>&1
ftmpdir="$path/vst.bK76A9SUkt"
if [ -z $path ]; then
ftmpdir="vst.bK76A9SUkt"
else
ftpc "mkdir $path" > /dev/null 2>&1
ftmpdir="$path/vst.bK76A9SUkt"
fi
ftp_result=$(ftpc "mkdir $ftmpdir" "rm $ftmpdir"|grep -v Trying)
if [ ! -z "$ftp_result" ] ; then
echo "$ftp_result"