rails_env=$1
if [ -z $rails_env ]; then
rails_env=development
fi
daemon_args=""
if [[ "$2" != "-ND" ]]; then
daemon_args="-D"
bundle exec unicorn_rails -c config/unicorn.rb -E $rails_env $daemon_args $3 $(if [ ! -z $4 ]; then echo '"'$4'"'; fi)