Skip to content

Instantly share code, notes, and snippets.

@Erikdegroot89
Created February 21, 2017 14:36
Show Gist options
  • Save Erikdegroot89/89795331a0cf344d4e24c319fcd23810 to your computer and use it in GitHub Desktop.
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)
#!/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