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