diff options
author | Florian Pritz <bluewind@server-speed.net> | 2011-03-10 18:27:41 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@server-speed.net> | 2011-03-10 18:27:51 +0100 |
commit | 483ddd7630faaa5942907659e658db3fe91c898b (patch) | |
tree | 605c977940af01844891b9d730283890cdddc349 /fb.in | |
parent | 0e1a715bd51611c69ab03f3b670db92fdad6563f (diff) |
check if the target file exists
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
Diffstat (limited to 'fb.in')
-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" |