Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Earthquake.init do
_ = config[:auto_restart] ||= {}
_[:interval] ||= 60 * 60
system "stty echo" # for readline
EM.defer do
sleep config[:auto_restart][:interval]
loop do
if Readline.line_buffer.nil? || Readline.line_buffer.empty?
STDOUT.print "auto "
input(":restart")
else
sleep 5
redo
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment