fix haproxy

This commit is contained in:
paukstelis
2023-01-20 18:13:52 -05:00
parent 857448f1c7
commit bc3733c8e9

View File

@@ -375,7 +375,7 @@ write_camera() {
echo SUBSYSTEM==\"video4linux\",KERNELS==\"$USBCAM\", SUBSYSTEMS==\"usb\", ATTR{index}==\"0\", DRIVERS==\"uvcvideo\", SYMLINK+=\"cam${INUM}_$INSTANCE\" >> /etc/udev/rules.d/99-octoprint.rules
fi
if [ -n $CAMHAPROXY ]; then
if [ -n "$CAMHAPROXY" ]; then
HAversion=$(haproxy -v | sed -n 's/^.*version \([0-9]\).*/\1/p')
#find frontend line, do insert
sed -i "/option forwardfor except 127.0.0.1/a\ use_backend cam${INUM}_$INSTANCE if { path_beg /cam${INUM}_$INSTANCE/ }" /etc/haproxy/haproxy.cfg