summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-06-12 11:36:21 +0200
committerFlorian Pritz <bluewind@xssn.at>2010-06-12 11:36:21 +0200
commitd0c3d6ed07129288d8f10a58909a3a1f062e3a0e (patch)
tree95fbe482a35d5185d229c3b5b52e34cb56fef2dd
parent85b34b7733e5b1b80797e3e8929ea5a3ceef7b3f (diff)
downloadbin-d0c3d6ed07129288d8f10a58909a3a1f062e3a0e.tar.gz
bin-d0c3d6ed07129288d8f10a58909a3a1f062e3a0e.tar.xz
fb: add http repaste support
Signed-off-by: Florian Pritz <bluewind@xssn.at>
-rwxr-xr-xfb10
1 files changed, 9 insertions, 1 deletions
diff --git a/fb b/fb
index 06dd87e..bd4d2b5 100755
--- a/fb
+++ b/fb
@@ -11,7 +11,7 @@
# Optional: xclip
#----------------------------------------------------
-VERSION="0.6.1"
+VERSION="0.6.2"
DELETE=0
EXTENSION=""
@@ -63,6 +63,7 @@ done
shift $((OPTIND - 1))
TMPDIR="$(mktemp -d "/tmp/fb.XXXXXX")"
+trap "rm -rf '${TMPDIR}'" EXIT INT TERM
if (($# == 0)); then
read_stdin "$TMPDIR/stdin"
@@ -73,8 +74,15 @@ else
curl -n -L "$PASTEBIN/file/delete/$i"
elif [[ $GET == 1 ]]; then
curl -s -o - "$PASTEBIN/$i"
+ elif [[ $i =~ ^(f|ht)tp(s)?://.+ ]]; then
+ cd $TMPDIR
+ curl -# -O "$i"
+ for f in *; do
+ do_upload "$f" && rm -f "$f"
+ done
else
do_upload $i
fi
done
fi
+