diff --git a/scripts/upload.sh b/scripts/upload.sh index 84240acf..0268c3df 100644 --- a/scripts/upload.sh +++ b/scripts/upload.sh @@ -165,16 +165,17 @@ ssh_mkdir() { set -e dir=`echo $1 | sed -e 's/\/[^\/]*$//; s/\/*$//'` - parts="/ `echo $dir | sed -e 's/\// /g'`" + parts="/ `echo $dir | sed -e 's%/% %g'`" test -n "$dir_mode" && MODE="-m $dir_mode" cat << EOT | + echo creating $parts for part in $parts; do path="\$path/\$part" if [ ! -d \$path ]; then mkdir \$path || break - test -n "$2" && chown "$2" \$path || break - test -n "$3" && chgrp "$3" \$path || break - test -n "$4" && chmod "$4" \$path || break + test -n "$2" && chown "$2" \$path || continue + test -n "$3" && chgrp "$3" \$path || continue + test -n "$4" && chmod "$4" \$path || continue fi if [ ! -d \$path ]; then echo "failed to create directory \$path, owner=\$file_owner, group=\$file_group, mode=\$dir_mode"