some minor changes, didn't finish.

This commit is contained in:
iRaven 2024-02-21 00:06:26 -06:00
parent 75b143a06a
commit 5da1959b94

View File

@ -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":