#!/bin/sh #---------------------------------------------------- # Version: 0.2.2 # Author: Florian "Bluewind" Pritz # # 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://filebin.server-speed.net/index.php/file/do_upload) echo $URL echo $URL | nohup &> /dev/null xclip if [ "$tmpfile" == "1" ]; then rm $file fi