Skip to content

Instantly share code, notes, and snippets.

@axgle
Created February 10, 2010 08:17
Show Gist options
  • Save axgle/300133 to your computer and use it in GitHub Desktop.
Save axgle/300133 to your computer and use it in GitHub Desktop.
默认一小时后关机
def shutdown(sec=3600)
system("shutdown -s -f -t " + sec.to_s)
end
shutdown
可以考虑用active_support指定详细的关机时刻!例如
require "active_support"
sec = 1.hour + 2.minutes + 3.seconds
shutdown(sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment