it finally fucking works

This commit is contained in:
iRaven 2024-02-22 23:47:24 -06:00
parent 39449ac9a2
commit a22c509000
2 changed files with 6 additions and 6 deletions

View File

@ -6,6 +6,5 @@
"server": "", "server": "",
"port": "", "port": "",
"ssh-user": "", "ssh-user": "",
"ssh-pw": "", "ssh-pw": ""
"ssh-key": ""
} }

View File

@ -42,11 +42,11 @@ def commandList():
def deploy(): def deploy():
downloadLatestCommands() downloadLatestCommands()
sshc.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # so we don't get whined at and crash over a unrecognized host-key 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: for command in shcommands:
sshc.exec_command(command) sshc.exec_command(command)
print(f'{command} was executed') print(f'{command} was executed on the ONT')
print("All commands were executed, now disconnecting...") print("All commands were executed, now disconnecting...")
sshc.close # close the connection. sshc.close # close the connection.
@ -56,8 +56,9 @@ def deploy():
while True: while True:
downloadLatestCommands() downloadLatestCommands() # Do this at first run
healthcheck() commandList() # Break all the commands into a list
healthcheck() # Run the health check for the first time
if healthstatus != "ok": 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!") print("ONT is not responding!! Did we lose network connection, or is the ONT rebooting? waiting for ONT to respond, then deploying payload!")