diff options
author | tv <tv@shackspace.de> | 2015-05-20 16:49:23 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-05-20 16:49:23 +0200 |
commit | 3cd71ef8189dc9226dfa01a91617d81ad4d429d6 (patch) | |
tree | b4bda0b3b7a09daca5f16f52c1148c1dacce4b86 /util/bin/paste | |
parent | a628b68dab6408ede1f695e9aa55c5df7b110e3b (diff) | |
parent | c5a4be51df09659d9bbf7da573b4568ce56b7514 (diff) |
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'util/bin/paste')
-rwxr-xr-x | util/bin/paste | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/util/bin/paste b/util/bin/paste new file mode 100755 index 00000000..b7cc6c99 --- /dev/null +++ b/util/bin/paste @@ -0,0 +1,26 @@ +#!/bin/sh +set -euf + +usage() { + echo 'paste reads from stdin and pastes to the specified paste service' + echo 'currently ix.io and paste.retiolum are supported' + echo 'default is paste.retiolum' + echo 'ex:' + echo 'cat somefile | paste ix.io' +} + +hoster=${1:-paste.retiolum} + +case $hoster in + paste.retiolum|paste) + curl -sS -F 'file=@-;type=text/plain' \ + http://paste.retiolum:5000/+upload \ + | sed -n 's|.*href="\([^#]*\).*|http://paste.retiolum\1\n|p' + ;; + ix.io) + curl -sS -F 'f:1=<-' ix.io + ;; + *) + usage + ;; +esac |