diff options
| author | shihaoyue <[email protected]> | 2024-06-23 14:59:02 +0800 |
|---|---|---|
| committer | shihaoyue <[email protected]> | 2024-06-23 14:59:02 +0800 |
| commit | a26acf272f5b2bf0a123aaab67a9a4cc97a0719d (patch) | |
| tree | 86d611f319827b6f893b31e02f1e2aed1453fb43 /agent/apps | |
| parent | 1ef2840676be92dfd7454e700e27e31f28eed3e7 (diff) | |
切换数据库
Diffstat (limited to 'agent/apps')
| -rw-r--r-- | agent/apps/script.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/agent/apps/script.py b/agent/apps/script.py index 7777feb..682e065 100644 --- a/agent/apps/script.py +++ b/agent/apps/script.py @@ -18,8 +18,7 @@ executor = ThreadPoolExecutor(5) BASE_PATH = "./apps/code/" # config config = {} -with open("./config.yaml", "r") as f: - config = yaml.safe_load(f) + @bp.post('/') @bp.doc("渗透任务参数接收接口", "返回任务执行状态") @@ -63,6 +62,8 @@ tasks_lock = threading.Lock() def execute_command(cmd, job_id, stop_event): + with open("./config.yaml", "r") as f: + config = yaml.safe_load(f) server_url = config['server'] try: proc = subprocess.Popen(cmd, |
