From a22c509000c64aa75437473b6131157fc2948ca6 Mon Sep 17 00:00:00 2001 From: iRaven4522 Date: Thu, 22 Feb 2024 23:47:24 -0600 Subject: [PATCH] it finally fucking works --- conf-template.json | 3 +-- deploy.py | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/conf-template.json b/conf-template.json index 6ac4485..e1e18a2 100644 --- a/conf-template.json +++ b/conf-template.json @@ -6,6 +6,5 @@ "server": "", "port": "", "ssh-user": "", - "ssh-pw": "", - "ssh-key": "" + "ssh-pw": "" } \ No newline at end of file diff --git a/deploy.py b/deploy.py index 1c0e485..ebc7c02 100644 --- a/deploy.py +++ b/deploy.py @@ -42,11 +42,11 @@ def commandList(): 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"],key_filename=cfg["ssh-key"]) + sshc.connect(cfg["server"],port=cfg["port"],username=cfg["ssh-user"],password=cfg["ssh-pw"]) for command in shcommands: sshc.exec_command(command) - print(f'{command} was executed') + print(f'{command} was executed on the ONT') print("All commands were executed, now disconnecting...") sshc.close # close the connection. @@ -56,8 +56,9 @@ def deploy(): while True: - downloadLatestCommands() - healthcheck() + downloadLatestCommands() # Do this at first run + commandList() # Break all the commands into a list + healthcheck() # Run the health check for the first time if healthstatus != "ok": print("ONT is not responding!! Did we lose network connection, or is the ONT rebooting? waiting for ONT to respond, then deploying payload!")