-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.py
37 lines (31 loc) · 1021 Bytes
/
run.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
from os import mkdir
from os.path import exists
from os.path import join as path_join
import shutil
from mce import PATH, PATH, PATH, PATH
from mce import initialize_db
from mce import nxc_logger
def first_run_setup(logger=nxc_logger):
if not exists(PATH):
mkdir(PATH)
if not exists(PATH):
logger.display("First time use detected")
logger.display("Creating home directory structure")
mkdir(PATH)
folders = (
"logs",
"modules",
"protocols",
"workspaces",
"obfuscated_scripts",
"screenshots",
)
for folder in folders:
if not exists(path_join(PATH, folder)):
logger.display(f"Creating missing folder {folder}")
mkdir(path_join(PATH, folder))
initialize_db()
if not exists(CONFIG_PATH):
logger.display("Copying default configuration file")
default_path = path_join(DATA_PATH, "nxc.conf")
shutil.copy(default_path, PATH)