Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- #actually I just wanted to try forking a gist :D
- exit unless ARGV.size == 1
- pids = %x[ps ax|grep #{ARGV[0]}|grep -v grep].split("\n").map{|line| line.strip.scan(/^\d+/).first.to_i} - [Process.pid]
- if pids.any?
- system "kill #{pids.join(' ')}"
- puts "killed #{pids.size} #{ARGV[0]} instance(s)"
- else
- puts "no rails processes found"
- end
Add Comment
Please, Sign In to add comment