commit 678419c9f7ef31357e0bc44511929d85a7725e98 parent f588afdd4159b8fe9a4cd542f20dea53dd95a6f6 Author: finwo <finwo@pm.me> Date: Mon, 21 Aug 2017 15:54:40 +0200 Uncommited changes Diffstat:
| M | run.sh | | | 12 | ++++++------ |
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/run.sh b/run.sh @@ -1,22 +1,22 @@ #!/usr/bin/env bash -XRARGS="-x -s http:0.0.0.0:$PORT" rm fifo.* 2>/dev/null test -v "$PORT" || PORT=5000 +XRARGS="-f -x -s http:0.0.0.0:$PORT" # Use a load-balancer if possible -command -v xr >/dev/null 2>/dev/null && { +if command -v xr >/dev/null 2>/dev/null; then for i in {0..9} ; do XRARGS="$XRARGS -b 127.0.0.1:800$i" echo Starting handler on 800$i - { while true ; do FIFO=$(hexdump -n 16 -v -e '/1 "%02X"' -e '/16 "\n"' /dev/urandom) ; mkfifo fifo.$FIFO ; nc -l -p 800$i < fifo.$FIFO | php init.php > fifo.$FIFO ; rm fifo.$FIFO ; done } & + { while true ; do FIFO=$(hexdump -n 16 -v -e '/1 "%02X"' -e '/16 "\n"' /dev/urandom) ; mkfifo fifo.$FIFO ; nc -l -p 800$i < fifo.$FIFO | php web/index.php > fifo.$FIFO ; rm fifo.$FIFO ; done } & done; echo Starting load-balancer on $PORT echo xr $XRARGS xr $XRARGS -} || { +else echo Starting on $PORT - while true ; do FIFO=$(hexdump -n 16 -v -e '/1 "%02X"' -e '/16 "\n"' /dev/urandom) ; mkfifo fifo.$FIFO ; nc -l -p $PORT < fifo.$FIFO | php init.php > fifo.$FIFO ; rm fifo.$FIFO ; done -} + while true ; do FIFO=$(hexdump -n 16 -v -e '/1 "%02X"' -e '/16 "\n"' /dev/urandom) ; mkfifo fifo.$FIFO ; nc -l -p $PORT < fifo.$FIFO | php web/index.php > fifo.$FIFO ; rm fifo.$FIFO ; done +fi