mirror of
https://github.com/sbrl/bin.git
synced 2018-01-10 21:33:46 +00:00
22 lines
No EOL
359 B
Bash
Executable file
22 lines
No EOL
359 B
Bash
Executable file
#!/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 http://$server/$output |