Skip to content

Instantly share code, notes, and snippets.

@blasterpal
Created April 3, 2014 13:21
Show Gist options
  • Select an option

  • Save blasterpal/9954221 to your computer and use it in GitHub Desktop.

Select an option

Save blasterpal/9954221 to your computer and use it in GitHub Desktop.
campfire-pid-watcher - need to gemify later...
require 'tinder'
pid = 2461
message = "DB restore complete!"
campfire = Tinder::Campfire.new 'subdomain', :token =>'zxzxc'
room = campfire.find_room_by_name 'roomname'
puts "watching and waiting for pid #{pid} to complete"
while `ps --no-headers #{pid}`.size > 0
puts "pid lives, waiting"
sleep 10
# try again
end
room.speak message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment