Description :
Change the delay time for restarting system
Note:
Run as localsystem user
delay="00:01:30"
import os
def get_sec(time_str):
"""Get Seconds from time."""
h, m, s = time_str.split(':')
return int(h) * 3600 + int(m) * 60 + int(s)
seconds=get_sec(delay)
#print seconds
try :
print os.popen("shutdown -r -t %s"%seconds).read()
print "The system will restart in %sq"%seconds
except Exception as E:
print E
Comments