From 5da1959b949a249c6550674e1e5a6a0891085dab Mon Sep 17 00:00:00 2001 From: iRaven4522 Date: Wed, 21 Feb 2024 00:06:26 -0600 Subject: [PATCH] some minor changes, didn't finish. --- deploy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy.py b/deploy.py index c85599b..3db6e0c 100644 --- a/deploy.py +++ b/deploy.py @@ -24,7 +24,7 @@ def healthcheck(): else: healthstatus = "ok" -def downloadLatestCommands(url): +def downloadLatestCommands(): r = requests.get(f'{url}') open(cfg["filepath"], 'wb').write(r.content) @@ -36,8 +36,9 @@ def commandList(): cmdtxt.close() def deploy(): + downloadLatestCommands() sshc.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # so we don't get whined at and crash over a unrecognized host-key - sshc.connect(cfg["server"],port=cfg["port"],username=cfg["ssh-user"],password=cfg["ssh-pw"],pkey=cfg["ssh-key"]) + sshc.connect(cfg["server"],port=cfg["port"],username=cfg["ssh-user"],password=cfg["ssh-pw"],key_filename=cfg["ssh-key"]) for command in shcommands: sshc.exec_command(command) @@ -51,6 +52,7 @@ def deploy(): while True: + downloadLatestCommands() healthcheck() if healthstatus != "ok":