forked from OWASP/SecureTea-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSecureTea.py
30 lines (26 loc) · 811 Bytes
/
SecureTea.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/python
# -*- coding: utf-8 -*-
"""Docstring."""
import os
import platform
import time
from securetea.core import SecureTea
if __name__ == '__main__':
secT = SecureTea()
try:
time.sleep(5)
platfom = platform.system()
if platfom == 'Linux':
command = 'sudo pm-suspend'
os_name = platform.dist()[0]
os_major_version = platform.dist()[1].split('.')[0]
if os_name == 'Ubuntu' and int(os_major_version) >= 16:
command = 'systemctl suspend'
os.system(command)
if platfom == 'Darwin':
os.system('pmset sleepnow')
if platfom == 'Windows':
os.system('rundll32.exe powerprof.dll, SetSuspendState 0,1,0')
except Exception as e:
print(e)
secT.run()