Skip to content

Commit 1ad955f

Browse files
committed
Fix HAProxy not working for version 3.x #867
1 parent 0d4cd57 commit 1ad955f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/modules/octopi/start_chroot_script

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,13 @@ then
279279
systemctl_if_exists enable gencert.service
280280

281281
haproxy_version=$(dpkg -s haproxy | grep '^Version:' | awk '{print $2}')
282-
if [[ $haproxy_version = 2.* ]]; then
283-
mv /etc/haproxy/haproxy.2.x.cfg /etc/haproxy/haproxy.cfg
284-
rm /etc/haproxy/haproxy.1.x.cfg
285-
else
282+
# Use 1.x config only for HAProxy 1.x, otherwise use 2.x+ config (works for 2.x, 3.x+)
283+
if [[ $haproxy_version = 1.* ]]; then
286284
mv /etc/haproxy/haproxy.1.x.cfg /etc/haproxy/haproxy.cfg
287285
rm /etc/haproxy/haproxy.2.x.cfg
286+
else
287+
mv /etc/haproxy/haproxy.2.x.cfg /etc/haproxy/haproxy.cfg
288+
rm /etc/haproxy/haproxy.1.x.cfg
288289
fi
289290
else
290291
# let's remove the configs for system services we don't need

0 commit comments

Comments
 (0)