diff options
author | Florian Pritz <bluewind@xssn.at> | 2010-06-12 11:36:21 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xssn.at> | 2010-06-12 11:36:21 +0200 |
commit | d0c3d6ed07129288d8f10a58909a3a1f062e3a0e (patch) | |
tree | 95fbe482a35d5185d229c3b5b52e34cb56fef2dd | |
parent | 85b34b7733e5b1b80797e3e8929ea5a3ceef7b3f (diff) | |
download | bin-d0c3d6ed07129288d8f10a58909a3a1f062e3a0e.tar.gz bin-d0c3d6ed07129288d8f10a58909a3a1f062e3a0e.tar.xz |
fb: add http repaste support
Signed-off-by: Florian Pritz <bluewind@xssn.at>
-rwxr-xr-x | fb | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 + |