-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
41 lines (34 loc) · 947 Bytes
/
run.py
File metadata and controls
41 lines (34 loc) · 947 Bytes
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
import logging
import os
import json
import sys
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s-%(levelname)s: %(message)s",
datefmt="%d-%b-%y %H:%M:%S",
)
def handle_config():
with open("config.json", "w") as f:
f.write(
json.dumps(
{
"discord_token": "",
"abuseipdb_token": "",
"mongo_uri": "",
"database_name": "",
}
)
)
logging.info("No config file found! Please fill in the one we just created.")
exit(1)
def usage():
print("Usage: python run.py [LIST OF PORTS]")
print(" Example: python run.py 25565 25566 25567")
exit(0)
if __name__ == "__main__":
if not os.path.exists("config.json"):
handle_config()
if len(sys.argv) <= 1:
usage()
from src.managers import Manager
Manager(sys.argv[1:]).start()