Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- pids = %x[ps ax|grep rails|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} rails instance(s)"
- else
- puts "no rails processes found"
- end
Add Comment
Please, Sign In to add comment