Skip to content

Instantly share code, notes, and snippets.

@groteck
Created November 19, 2013 02:20
Show Gist options
  • Save groteck/7539188 to your computer and use it in GitHub Desktop.
Save groteck/7539188 to your computer and use it in GitHub Desktop.
daemonice command when all is ok
#!/usr/bin/env ruby
require 'io/console'
io = IO.popen("ping www.google.com")
io.each do |line|
if line.include? "icmp_seq=5"
puts "ok"
Process.daemon(io.pid)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment