forked from IDeletedSystem64/iptables-deploy
		
	some minor changes, didn't finish.
This commit is contained in:
		| @@ -24,7 +24,7 @@ def healthcheck(): | ||||
|     else:  | ||||
|         healthstatus = "ok" | ||||
|  | ||||
| def downloadLatestCommands(url): | ||||
| def downloadLatestCommands(): | ||||
|     r = requests.get(f'{url}') | ||||
|     open(cfg["filepath"], 'wb').write(r.content) | ||||
|  | ||||
| @@ -36,8 +36,9 @@ def commandList(): | ||||
|     cmdtxt.close() | ||||
|  | ||||
| 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"],pkey=cfg["ssh-key"]) | ||||
|     sshc.connect(cfg["server"],port=cfg["port"],username=cfg["ssh-user"],password=cfg["ssh-pw"],key_filename=cfg["ssh-key"]) | ||||
|  | ||||
|     for command in shcommands: | ||||
|         sshc.exec_command(command) | ||||
| @@ -51,6 +52,7 @@ def deploy(): | ||||
|  | ||||
|  | ||||
| while True: | ||||
|     downloadLatestCommands() | ||||
|     healthcheck() | ||||
|  | ||||
|     if healthstatus != "ok": | ||||
|   | ||||
		Reference in New Issue
	
	Block a user