Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- PORT="$1"
- FILE="$2"
- SIZE=`/usr/bin/wc -c "$FILE" | /usr/bin/awk '{print$1}'`
- (
- /bin/cat <<EoF
- HTTP/1.1 200 OK
- Content-Type: application/octet-stream
- Content-Disposition: attachment; filename="$FILE"
- Content-Length: $SIZE
- Connection: close
- EoF
- /bin/cat "$FILE"
- ) | /bin/nc -lp $PORT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement