blob: e420c64272f4338992f4bcece2102c9a057c9d44 [file] [log] [blame]
Paul Stewart23cfe942010-09-29 16:32:31 -07001#!/usr/bin/python
2
Julius Wernera825d252012-12-17 16:22:06 -08003"""Tell system to suspend, and resume some number of seconds later."""
Paul Stewart23cfe942010-09-29 16:32:31 -07004
5import os, re, subprocess, sys
6import rtc, sys_power
7
8time_to_sleep = 30
9if len(sys.argv) > 1:
10 time_to_sleep = int(sys.argv[1])
11
12if len(sys.argv) > 2:
13 after_command = ' '.join(sys.argv[2:])
14else:
15 after_command = None
16
Julius Wernera825d252012-12-17 16:22:06 -080017sys_power.do_suspend(time_to_sleep)
Paul Stewart23cfe942010-09-29 16:32:31 -070018
19if after_command:
20 os.system(after_command)