-
-
Save bumi/22367 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment