forked from IDeletedSystem64/iptables-deploy
it finally fucking works
This commit is contained in:
parent
39449ac9a2
commit
a22c509000
@ -6,6 +6,5 @@
|
||||
"server": "",
|
||||
"port": "",
|
||||
"ssh-user": "",
|
||||
"ssh-pw": "",
|
||||
"ssh-key": ""
|
||||
"ssh-pw": ""
|
||||
}
|
@ -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!")
|
||||
|
Loading…
x
Reference in New Issue
Block a user