diff options
-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 + |