Skip to content

Instantly share code, notes, and snippets.

@kilrizzy
Last active January 10, 2017 00:40
Show Gist options
  • Save kilrizzy/e2cd720134a3f3a42e98426786359ea0 to your computer and use it in GitHub Desktop.
Save kilrizzy/e2cd720134a3f3a42e98426786359ea0 to your computer and use it in GitHub Desktop.
Automate Homestead (host sitekey site/directory)
#!/bin/bash
KEY=$1
DIRECTORY=$2
DOMAIN=$KEY".app"
DATABASE=$KEY
/bin/bash /c/scripts/add-site.sh $DOMAIN $DIRECTORY $DATABASE
#!/bin/bash
DOMAIN=$1
DIRECTORY=$2
DATABASE=$3
printf "\n192.168.10.10 ${DOMAIN}" >> "/c/Windows/System32/drivers/etc/hosts"
sed -i "/sites:/a \ \ \ \ - map: ${DOMAIN}\r\n\ \ \ \ \ \ to: /home/vagrant/www/${DIRECTORY}/public" "/c/.homestead/Homestead.yaml"
sed -i "/databases:/a \ \ \ \ - ${DATABASE}" "/c/.homestead/Homestead.yaml"
cd "/c/Homestead"
vagrant provision
host=bash C:\scripts\add-site-key.sh $1 $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment