diff options
author | Florian Pritz <f-p@gmx.at> | 2009-06-27 22:55:34 +0200 |
---|---|---|
committer | Florian Pritz <f-p@gmx.at> | 2009-06-27 22:55:34 +0200 |
commit | ca1e0e165fa9258d1e06885e4a2438c84ed21bbe (patch) | |
tree | b6c04f0034208aca237598522677071c5986c36a | |
parent | be44b6fa8f378fb494239611b98e13bb4b51f45c (diff) | |
download | bin-ca1e0e165fa9258d1e06885e4a2438c84ed21bbe.tar.gz bin-ca1e0e165fa9258d1e06885e4a2438c84ed21bbe.tar.xz |
filebin.sh now uses stdin
-rwxr-xr-x | filebin.sh | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -1,6 +1,6 @@ #!/bin/sh #---------------------------------------------------- -# Version: 0.1.0 +# Version: 0.2.0 # Author: Florian "Bluewind" Pritz <f-p@gmx.at> # # Licensed under WTFPL v2 @@ -11,6 +11,20 @@ # (only works if useragent contains libcurl) #---------------------------------------------------- -URL=$(curl -# -L -F "userfile=@$1" http://filebin.server-speed.net/index.php/file/do_upload) +tmpfile=0 +if [ -n "$1" ]; then + file=$1 +else + file=$(mktemp) + tmpfile=1 + read -r input + echo $input > $file +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 |