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":