-
Notifications
You must be signed in to change notification settings - Fork 0
/
launcher.py
executable file
·34 lines (27 loc) · 948 Bytes
/
launcher.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
31
32
33
34
#!/usr/bin/python3
from core import core
from constants import constants
import sys, time, logging, os
if __name__ == "__main__":
logging.basicConfig(format='%(asctime)s.%(msecs)03d - %(levelname)s - %(name)s - %(message)s',
filename= os.path.dirname(os.path.realpath(__file__)) +'/log.log', level=logging.DEBUG, datefmt='%d-%m-%Y %H:%M:%S')
#logging.basicConfig(format='%(asctime)s.%(msecs)03d - %(levelname)s - %(name)s - %(message)s',
#level=logging.DEBUG, datefmt='%d-%m-%Y %H:%M:%S')
if len(sys.argv) == 6:
constants.EMAIL = sys.argv[2]
constants.EMAIL_PASSWORD = sys.argv[3]
constants.USER = sys.argv[4]
constants.USER_PASSWORD = sys.argv[5]
if 'test' == sys.argv[1]:
core.scan()
elif 'scan' == sys.argv[1]:
core.scan()
elif 'restart' == sys.argv[1]:
core.scan()
else:
print("Unknown command")
sys.exit(2)
sys.exit(0)
else:
print("usage: {} scan|test|restart".format(sys.argv[0]))
sys.exit(2)