diff options
author | Florian Pritz <f-p@gmx.at> | 2009-07-12 02:14:59 +0200 |
---|---|---|
committer | Florian Pritz <f-p@gmx.at> | 2009-07-12 02:14:59 +0200 |
commit | 2572c8d2d1b8d804af53d6a772c1b358751a86ad (patch) | |
tree | e1edd2b47e6c90223bc7fd27371687dfa154a2f7 /fb | |
parent | 9dba52882d74d9c62ce9473ac9781f7ca6599fd2 (diff) | |
download | bin-2572c8d2d1b8d804af53d6a772c1b358751a86ad.tar.gz bin-2572c8d2d1b8d804af53d6a772c1b358751a86ad.tar.xz |
rename filebin.sh and change domain
Diffstat (limited to 'fb')
-rwxr-xr-x | fb | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -0,0 +1,32 @@ +#!/bin/sh +#---------------------------------------------------- +# Version: 0.2.3 +# Author: Florian "Bluewind" Pritz <f-p@gmx.at> +# +# Licensed under WTFPL v2 +# (see COPYING for full license text) +# +#---------------------------------------------------- +# Upload file to my filebin and copy URL to clipboard +# or nopaste stdin +# (only works if useragent contains libcurl) +#---------------------------------------------------- + +tmpfile=0 +if [ -n "$1" ]; then + file=$1 +else + file=$(mktemp) + tmpfile=1 + while read -r input; do + echo "$input" >> $file + done +fi + +URL=$(curl -# -L -F "userfile=@$file" http://paste.xinu.at/file/do_upload) +echo $URL +echo -n $URL | nohup &> /dev/null xclip + +if [ "$tmpfile" == "1" ]; then + rm $file +fi |