diff options
author | sullrich <sullrich@pfsense.org> | 2009-12-16 10:25:03 -0500 |
---|---|---|
committer | sullrich <sullrich@pfsense.org> | 2009-12-16 10:25:03 -0500 |
commit | 6953fe31431d6dd8a527e082b2608716953cc5b5 (patch) | |
tree | 0692a7d80347829181861d10a5500ca2d8e488f5 | |
parent | b2709078ab7a199f1adbd0a54864c44252bcc7db (diff) | |
download | pfsense-packages-6953fe31431d6dd8a527e082b2608716953cc5b5.tar.gz pfsense-packages-6953fe31431d6dd8a527e082b2608716953cc5b5.tar.bz2 pfsense-packages-6953fe31431d6dd8a527e082b2608716953cc5b5.zip |
Seperate out ports to one port per server per line
-rw-r--r-- | config/haproxy/haproxy.inc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/config/haproxy/haproxy.inc b/config/haproxy/haproxy.inc index 6e8c4261..0890dbc7 100644 --- a/config/haproxy/haproxy.inc +++ b/config/haproxy/haproxy.inc @@ -212,26 +212,22 @@ function haproxy_configure() { if($backends == "") continue; if($backends == $backend['name']) { + $server_ports = array(); if($server['status']=='active') { if($server['cookie']) $cookie = " cookie {$server['cookie']} "; else $cookie = ""; if(!$server['port']) { - $server_ports = ""; - $isfirst = true; foreach($ports as $port) { - if($port) { - if(!$isfirst) - $server_ports .= ","; - $server_ports .= $port; - $isfirst = false; - } + if($port) + $server_ports[] = $port; } } else { - $server_ports = $server['port']; + $server_ports[] = $server['port']; } - fwrite ($fd, "\tserver\t\t\t" . $server['name'] . " " . $server['address'].":" . $server_ports . " $cookie " . " check inter 1000 weight " . $server['weight'] . "\n"); + foreach($server_ports as $pport) + fwrite ($fd, "\tserver\t\t\t" . $server['name'] . " " . $server['address'].":" . $pport . " $cookie " . " check inter 1000 weight " . $server['weight'] . "\n"); } } } |