#!/bin/bash name=$1 prod_path="/var/www/rails_apps/prod/" dev_path="/var/www/rails_apps/dev/" path="$dev_path$name" if [ -z $name ] ; then echo "usage: $0 appname" exit 1; fi rm -rf $prod_path$name rm -rf $dev_path$name rm -f /etc/apache2/sites-enabled/prod.$name.conf rm -f /etc/apache2/sites-enabled/dev.$name.conf sudo service apache2 reload