it finally fucking works
This commit is contained in:
@@ -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!")
|
||||
|
Reference in New Issue
Block a user