server's state saving fix

Current save_command trying to write socket file into state file (not stdout) and it can't be passed over ssh as list.
pull/227/head
pjclock 5 years ago committed by GitHub
parent 2ea59c892a
commit decc302c12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -603,8 +603,8 @@ if form.getvalue('servaction') is not None:
cmd='echo "%s %s" |sudo socat stdio %s | cut -d "," -f 1-2,5-10,18,34-36 | column -s, -t' % (enable, backend, haproxy_sock)
if form.getvalue('save') == "on":
save_command = 'echo "show servers state" | sudo socat stdio %s > %s' % (haproxy_sock, server_state_file)
command = [ cmd, save_command ]
save_command = 'echo "show servers state" | sudo socat %s stdio > %s' % (haproxy_sock, server_state_file)
command = [ cmd + ';' + save_command ]
else:
command = [ cmd ]
@ -1628,4 +1628,4 @@ if form.getvalue('updatesettings') is not None:
val = form.getvalue('val')
if sql.update_setting(settings, val):
funct.logging('value '+val, ' changed settings '+settings, haproxywi=1, login=1)
print("Ok")
print("Ok")

Loading…
Cancel
Save