Created
August 18, 2009 21:40
-
-
Save careo/169994 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| $stdout.sync = true | |
| cmd = ARGV.join " " | |
| puts "going to execute: #{cmd}" | |
| puts "note: I'll retry the command endlessly, regardless of exit status." | |
| puts "I will, however, wait 5 seconds before restarting to give you time" | |
| puts "to kill me and not my subprocess" | |
| loop do | |
| system cmd | |
| print "command terminated. sleeping... " | |
| sleep 5 | |
| puts "restarting" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment