Skip to content
Snippets Groups Projects

6431 haproxy fix

Merged Hahn Axel (hahn) requested to merge 6431-haproxy-fix into master
1 file
+ 3
2
Compare changes
  • Side-by-side
  • Inline
inc_haproxy_cfg.sh 100644 → 100755
+ 3
2
@@ -7,6 +7,7 @@
@@ -7,6 +7,7 @@
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# 2021-12-14 v1.0 <axel.hahn@iml.unibe.ch> init
# 2021-12-14 v1.0 <axel.hahn@iml.unibe.ch> init
# 2022-10-21 v1.1 <axel.hahn@unibe.ch> remove grep: warning: stray \ before white space
# 2022-10-21 v1.1 <axel.hahn@unibe.ch> remove grep: warning: stray \ before white space
 
# 2023-06-09 v1.2 <axel.hahn@unibe.ch> take first haproxy stats port on multiple binds
# ======================================================================
# ======================================================================
# full path to haproxy.cfg
# full path to haproxy.cfg
@@ -140,8 +141,8 @@ function getStatsBaseUrl(){
@@ -140,8 +141,8 @@ function getStatsBaseUrl(){
local mysection=$( detectStatsSection )
local mysection=$( detectStatsSection )
# read config
# read config
port=$( getCfgVar "bind" "${mysection}" | cut -f 2 -d ":")
port=$( getCfgVar "bind" "${mysection}" | cut -f 2 -d ":" | head -1 )
auth=$( getCfgVar "stats" "${mysection}" | grep "^auth" | cut -f 2- -d " " )
auth=$( getCfgVar "stats" "${mysection}" | grep "^auth" | cut -f 2- -d " " | head -1 )
# build url
# build url
url="$proto://"
url="$proto://"
Loading