summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@server-speed.net>2011-03-10 18:27:41 +0100
committerFlorian Pritz <bluewind@xinu.at>2011-09-11 21:55:09 +0200
commitd96aeea09bd0c98d2e8570840412a7efbcbb56a3 (patch)
tree605c977940af01844891b9d730283890cdddc349
parent0e1a715bd51611c69ab03f3b670db92fdad6563f (diff)
check if the target file exists
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
-rw-r--r--fb.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/fb.in b/fb.in
index 48dc777..f6877ae 100644
--- a/fb.in
+++ b/fb.in
@@ -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"