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