summaryrefslogtreecommitdiffstats
path: root/fb.in
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@server-speed.net>2011-03-10 18:27:41 +0100
committerFlorian Pritz <bluewind@server-speed.net>2011-03-10 18:27:51 +0100
commit483ddd7630faaa5942907659e658db3fe91c898b (patch)
tree605c977940af01844891b9d730283890cdddc349 /fb.in
parent0e1a715bd51611c69ab03f3b670db92fdad6563f (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.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"