aboutsummaryrefslogtreecommitdiffstats
path: root/sprunc
blob: 5e59bcf38a2a33024f7c29f2abc382e350e4e330 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/busybox sh

stdin=$(cat /dev/stdin)
uuenc=$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$stdin")

content_length=$(( ${#uuenc} + $(expr length "sprunge=") ))

/usr/bin/nc sprunge.us 80 <<EOF | awk '/17/{getline; print}'
POST / HTTP/1.1
Host:sprunge.us
Content-Type:application/x-www-form-urlencoded
Content-Length:$content_length

sprunge=$uuenc
EOF