Skip to content

Instantly share code, notes, and snippets.

@DAddYE
Created August 26, 2011 12:47
Show Gist options
  • Save DAddYE/1173337 to your computer and use it in GitHub Desktop.
Save DAddYE/1173337 to your computer and use it in GitHub Desktop.
##
# File watcher
#
# Example for: https://twitter.com/rakaur/status/107070299400441858
#
loop do
if File.exist?('tmp/restart.txt')
# TODO: add here code to reboot
# Remember to remove restart.txt to prevent loops
File.rm('tmp/restart.txt')
# Exit from loop
break
else
# Sleep a 1 second
sleep 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment