Skip to content

Commit

Permalink
updated check_haproxy_syntax.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
HariSekhon committed Feb 14, 2025
1 parent 1a95e0a commit 0b7a745
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion check_haproxy_syntax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ test_haproxy_conf(){
local cfg="$1"
local str
str="$(printf "%-${maxwidth}s " "$cfg:")"
if haproxy -v | grep -q '^HAProxy version 1'; then
if grep -q '^[[:space:]]*http-check send meth' "$cfg"; then
echo "Skipping due to old HAProxy version not supporting 'http-check send meth'"
return
fi
fi
if haproxy -c -f 10-global.cfg -f 20-stats.cfg -f "$cfg" &>/dev/null; then
echo "$str OK"
if ! grep -q "^$cfg$" <<< "$configs_without_acls"; then
Expand Down Expand Up @@ -109,7 +115,7 @@ if command -v haproxy &>/dev/null; then
echo
maxwidth=0
for cfg in $configs; do
if [ "${#cfg}" -gt $maxwidth ]; then
if [ "${#cfg}" -gt "$maxwidth" ]; then
maxwidth="${#cfg}"
fi
done
Expand Down

0 comments on commit 0b7a745

Please sign in to comment.