29 lines
517 B
Bash
29 lines
517 B
Bash
#!/bin/bash
|
|
|
|
START_PORT=30000
|
|
END_PORT=31000
|
|
|
|
for PORT in $(seq $START_PORT $END_PORT); do
|
|
cat <<EOF
|
|
frontend tcp-$PORT
|
|
mode tcp
|
|
bind *:$PORT
|
|
option tcplog
|
|
default_backend tcp-$PORT
|
|
|
|
backend tcp-$PORT
|
|
mode tcp
|
|
balance roundrobin
|
|
option tcplog
|
|
option dontlog-normal
|
|
option dontlognull
|
|
option tcp-check
|
|
default-server check maxconn 50
|
|
server gpu-1 10.140.224.11:$PORT check
|
|
server gpu-2 10.140.224.12:$PORT check
|
|
server gpu-3 10.140.224.13:$PORT check
|
|
|
|
EOF
|
|
done
|
|
|