diff options
author | Florian Pritz <bluewind@server-speed.net> | 2011-03-10 18:27:41 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-09-11 21:55:09 +0200 |
commit | d96aeea09bd0c98d2e8570840412a7efbcbb56a3 (patch) | |
tree | 605c977940af01844891b9d730283890cdddc349 | |
parent | 0e1a715bd51611c69ab03f3b670db92fdad6563f (diff) |
check if the target file exists
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
-rw-r--r-- | fb.in | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -31,6 +31,13 @@ do_upload() { file="$1" basefilename="`basename -- "$file"`" basedirname="`dirname -- "$file"`" + + if [ ! -e "$file" ]; then + echo "Error: File \"$file\" doesn't exist" >&2 + EXITCODE=1 + return 1 + fi + if [ -d "$file" ]; then cd "$basedirname" tar $TAROPTS -cf "$TMPDIR/$basefilename$TAREXT" -- "$basefilename" |