Created
May 16, 2011 20:59
-
-
Save iamjwc/975362 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
IP=`ifconfig | grep "inet " | grep -v "inet 127.0.0.1" | cut -f 2 -d " "` | |
PORT=$1 | |
if [ -z "$1" ] | |
then | |
PORT=8000 | |
fi | |
# Copy ip and port to pasteboard | |
echo $IP:$PORT | pbcopy | |
echo Serving at $IP:$PORT | |
# Start http server on port passed in | |
python -m SimpleHTTPServer $PORT &> /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment