Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ $# -eq 2 ]; then
- url=$(printf "%s:%s" $(ip route get 8.8.8.8 | awk 'NR==1 {print $NF}') $1)
- qrencode -l H -o - $url | display&
- { echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <$2)\r\n\r\n"; cat $2; } | nc -l -p $1;
- echo "sent";
- exit;
- fi
- if [ $# -eq 1 ]; then
- url=$(printf "%s:8080" $(ip route get 8.8.8.8 | awk 'NR==1 {print $NF}'))
- qrencode -l H -o - $url | display&
- { echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <$1)\r\n\r\n"; cat $1; } | nc -l -p 8080;
- echo "sent";
- exit;
- fi
- echo "usage simphost file or simphost port file";
- echo "done";
Advertisement
Add Comment
Please, Sign In to add comment