Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- config.vm.provision "shell", inline: <<-SHELL
- ## Only thing you probably really care about
- DOMAINS=("site1" "site2" "site3")
- ## Loop through all sites
- for ((i=0; i < ${#DOMAINS[@]}; i++)); do
- ## Current Domain
- DOMAIN=${DOMAINS[$i]}
- echo "Creating directory for $DOMAIN..."
- mkdir -p /var/www/$DOMAIN/public
- echo "Creating vhost config for $DOMAIN..."
- sudo cp /etc/apache2/sites-available/scotchbox.local.conf /etc/apache2/sites-available/$DOMAIN.conf
- echo "Updating vhost config for $DOMAIN..."
- sudo sed -i s,scotchbox.local,$DOMAIN,g /etc/apache2/sites-available/$DOMAIN.conf
- sudo sed -i s,/var/www/public,/var/www/$DOMAIN/public,g /etc/apache2/sites-available/$DOMAIN.conf
- echo "Enabling $DOMAIN. Will probably tell you to restart Apache..."
- sudo a2ensite $DOMAIN.conf
- echo "So let's restart apache..."
- sudo service apache2 restart
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement