#!/bin/bash # # usage: ./adp-new-vhost # mampdir=/Applications/MAMP confdir=$mampdir/conf/apache/extra/vhosts codedir=~/Code mampport=80 cat < $confdir/$1.conf ServerName $1 DocumentRoot $codedir/$1 AllowOverride all Options -Indexes Order allow,deny Allow from all end echo | sudo -- sh -c "echo '127.0.0.1 $1' >> /etc/hosts"