Created
July 15, 2014 01:16
-
-
Save jonahbron/0c27f046ce46bc5bd766 to your computer and use it in GitHub Desktop.
Single file server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
serve_file=$1 | |
ip_addr=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') | |
echo "$ip_addr:8000" | |
while true ; do nc -l 8000 < "$serve_file" ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment