diff options
author | PiBa-NL <pba_2k3@yahoo.com> | 2014-03-19 19:45:15 +0100 |
---|---|---|
committer | PiBa-NL <pba_2k3@yahoo.com> | 2014-03-19 19:45:15 +0100 |
commit | b364f1dc126b549b243f81dd087ee2e345a1eb2c (patch) | |
tree | e22831bbb55221cf6e6f43e2a2a416da305ec6cd | |
parent | 39b3fe5d22482d16a161193167c00af90390343a (diff) | |
download | pfsense-packages-b364f1dc126b549b243f81dd087ee2e345a1eb2c.tar.gz pfsense-packages-b364f1dc126b549b243f81dd087ee2e345a1eb2c.tar.bz2 pfsense-packages-b364f1dc126b549b243f81dd087ee2e345a1eb2c.zip |
haproxy-devel, use global $aliastable for looking up aliases, call haproxy_check_run() on installation to start upgraded version if already enabled.
-rw-r--r-- | config/haproxy-devel/haproxy.inc | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/config/haproxy-devel/haproxy.inc b/config/haproxy-devel/haproxy.inc index 76b836b6..0c59a03d 100644 --- a/config/haproxy-devel/haproxy.inc +++ b/config/haproxy-devel/haproxy.inc @@ -212,21 +212,16 @@ function group_ports($ports) { function haproxy_portoralias_to_list($port_or_alias) { // input: a port or aliasname: 80 https MyPortAlias // returns: a array of ports and portranges 80 443 8000:8010 - global $config; + global $aliastable; $portresult = array(); - if (is_alias($port_or_alias)) { - if (is_array($config['aliases']['alias'])) { - foreach ($config['aliases']['alias'] as $alias) { - if ($alias['name'] == $port_or_alias && preg_match("/port/i", $alias['type'])) { - $ports = explode(' ',$alias['address']); - foreach($ports as $port) { - $portresults = haproxy_portoralias_to_list($port); - $portresult = array_merge($portresult, $portresults); - } - return $portresult; - } - } + if (alias_get_type($port_or_alias) == "port") { + $aliasports = $aliastable[$port_or_alias]; + $ports = explode(' ',$aliasports); + foreach($ports as $port) { + $portresults = haproxy_portoralias_to_list($port); + $portresult = array_merge($portresult, $portresults); } + return $portresult; } else if (is_portrange($port_or_alias)) { return (array)$port_or_alias; } else if (is_port($port_or_alias)) { @@ -436,9 +431,9 @@ EOD; update_output_window($static_output); conf_mount_ro(); - $static_output .= "HAProxy, calling: haproxy.sh start\n"; + $static_output .= "HAProxy, starting haproxy (if previously enabled)\n"; update_output_window($static_output); - exec("/usr/local/etc/rc.d/haproxy.sh start"); + haproxy_check_run(1); $static_output .= "HAProxy, running haproxy_custom_php_install_command() DONE\n"; update_output_window($static_output); |