mirror of
https://github.com/sbrl/bin.git
synced 2018-01-10 21:33:46 +00:00
22 lines
352 B
Text
22 lines
352 B
Text
|
#!/bin/bash
|
||
|
|
||
|
server='hastebin.com';
|
||
|
|
||
|
usage="$0 pastes into $server
|
||
|
usage: $0 something
|
||
|
example: '$0 pie' or 'ps aufx |$0'"
|
||
|
|
||
|
if [ -z $1 ]; then
|
||
|
str=`cat /dev/stdin`;
|
||
|
else
|
||
|
str=$1;
|
||
|
fi
|
||
|
|
||
|
if [ -z "$str" ]; then
|
||
|
echo $usage;
|
||
|
exit 1;
|
||
|
fi
|
||
|
|
||
|
output=`curl -s -X POST -d "$str" $server/documents |perl -pi -e 's|.+:\"(.+)\"}|$1|'`
|
||
|
|
||
|
echo $server/$output
|