summaryrefslogtreecommitdiffstats
path: root/fb
diff options
context:
space:
mode:
Diffstat (limited to 'fb')
-rwxr-xr-xfb10
1 files changed, 6 insertions, 4 deletions
diff --git a/fb b/fb
index cfd661c..8d4af3b 100755
--- a/fb
+++ b/fb
@@ -10,13 +10,14 @@
# Optional: xclip
#----------------------------------------------------
-VERSION="0.6.3.1"
+VERSION="0.6.3.2"
DELETE=0
EXTENSION=""
GET=0
PASTEBIN="http://paste.xinu.at"
USERAGENT="fb-client/$VERSION"
+CLIPBOARD=""
do_upload() {
local EXTRA=""
@@ -28,7 +29,7 @@ do_upload() {
sed '$d' $TMPFILE >&2
URL=$(tail -1 $TMPFILE)
echo $URL
- echo -n "$URL" | nohup &> /dev/null xclip || true
+ CLIPBOARD="$CLIPBOARD $URL"
}
read_stdin() {
@@ -41,7 +42,7 @@ read_stdin() {
help() {
echo "fb-client version $VERSION"
echo "usage: [cat |] $(basename "$0") [switches] [file(s)|ID(s)]"
- echo " Upload/nopaste file/stdin to paste.xinu.at and copy URL to clipboard."
+ echo " Upload/nopaste file(s)/stdin to paste.xinu.at and copy URL(s) to clipboard."
echo " ~/.netrc: machine paste.xinu.at password PASSWORD"
echo ""
echo "Switches:"
@@ -77,7 +78,7 @@ else
curl -n -L -A $USERAGENT "$PASTEBIN/file/delete/$i"
elif [[ $GET == 1 ]]; then
curl -s -o - -A $USERAGENT "$PASTEBIN/$i"
- elif [[ $i =~ ^(f|ht)tp(s)?://.+ ]]; then
+ elif grep -qE "^(f|ht)tp(s)?://.+" <<< "$i"; then
cd $TMPDIR
curl -# -A $USERAGENT -O "$i"
for f in *; do
@@ -89,3 +90,4 @@ else
done
fi
+echo -n "$CLIPBOARD" | nohup &> /dev/null xclip || true