#!/usr/bin/env ruby # # mongrel Startup script for Mongrel by Tim Morgan # # chkconfig: - 85 15 # description: mongrel manages Mongrel # app_dir = '/var/rails' apps = { 'hpy' => 8001, '43verses' => 8002 } if ['stop', 'restart'].include? ARGV.first apps.each do |path, port| path = File.join app_dir, path puts "Stopping #{path}..." `mongrel_rails stop -c #{path} -P log/mongrel.pid` end end if ['start', 'restart'].include? ARGV.first apps.each do |path, port| path = File.join app_dir, path puts "Starting #{path} on #{port}..." `mongrel_rails start -d -p #{port} -e production -c #{path} -P log/mongrel.pid` end end unless ['start', 'stop', 'restart'].include? ARGV.first puts "Usage: mongrel {start|stop|restart}" exit end
You need to create an account or log in to post comments to this site.