Created
February 21, 2017 14:36
-
-
Save Erikdegroot89/89795331a0cf344d4e24c319fcd23810 to your computer and use it in GitHub Desktop.
Simple shell script to link your homestead app to your hosts file (use like add_app.sh something.app)
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
#!/bin/bash | |
IP=$( awk -F'"' '$0=$2' ~/.homestead/Homestead.yaml ); | |
APPNAME=$1 | |
if [[ -z "$IP" ]] | |
then | |
echo "could not determine IP... please start the vagrant box first!" | |
else | |
sudo -- sh -c -e "echo '$IP $APPNAME' >> /etc/hosts" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment