-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.py
43 lines (33 loc) · 964 Bytes
/
main.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
35
36
37
38
39
40
41
42
43
import sys
import time
import signal
import logging
import schedule
import traceback
import module
from ioc import schedule_iocs
from event import Events, broadcast_event
import cli
if __name__ == "__main__":
broadcast_event(Events.INITIALIZE)
logging.info("Initialized Fairplay!")
try:
schedule_iocs()
while True:
try:
schedule.run_pending()
time.sleep(1)
except KeyboardInterrupt:
signal.signal(signal.SIGINT, cli.handler)
except SystemExit:
broadcast_event(Events.TERMINATE)
sys.exit(0)
except:
print("[!] Generic error! Please be kind enough to open an issue with the stack trace information below:")
print("")
traceback.print_exc()
print("")
print("[+] Exiting gracefully...")
logging.info("Terminating Fairplay!")
broadcast_event(Events.TERMINATE)
sys.exit(1)