12345678910111213141516171819202122 |
- #!/bin/sh
-
- url="www.pbin.in/upload.php"
-
- if [ "$1" = "" ]; then
- echo "pbin <file> [name]"
- exit
- elif [ ! -s "$1" ]; then
- echo "$1: no such file"
- exit
- fi
-
- content=`cat $1`
-
- name=`curl "$url" -s -F "name=$2" -F "content=$content"`
-
- if [ $? -eq 0 ]; then
- echo "http://pbin.in/$name" | xclip
- echo "http://pbin.in/$name"
- else
- echo "There was an error. The file you provided may be too big."
- fi
|