Created
September 21, 2016 07:16
-
-
Save baurine/2c6f401eea18196382c74cd77bf53132 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env sh | |
usage() { | |
echo "Usage:" | |
echo " run_with_ip" | |
echo " run_with_ip ip" | |
} | |
arg=$1 | |
if [ -z "$arg" ]; then | |
rails s | |
elif [ $arg == "ip" ]; then | |
ip=$(ifconfig en0 | grep 'inet\b' | awk '{print $2}') | |
rails s -b $ip | |
else | |
usage | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment