Changelog: https://roxy-wi.org/changelog#6_3_8
pull/364/head
Aidaho 2023-03-26 11:56:31 +03:00
parent 3300318616
commit c5b33138ba
1 changed files with 10 additions and 7 deletions

View File

@ -112,13 +112,16 @@ def check_haproxy_config(server_ip):
else: else:
commands = [f"haproxy -q -c -f {config_path}"] commands = [f"haproxy -q -c -f {config_path}"]
with mod_ssh.ssh_connect(server_ip) as ssh: try:
for command in commands: with mod_ssh.ssh_connect(server_ip) as ssh:
stdin, stdout, stderr = ssh.run_command(command) for command in commands:
if not stderr.read(): stdin, stdout, stderr = ssh.run_command(command, timeout=5)
return True if not stderr.read():
else: return True
return False else:
return False
except Exception as e:
print(f'error: {e}')
def check_nginx_config(server_ip): def check_nginx_config(server_ip):