From 5f6646b60e05b80799d91ccaa288a230af47a820 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sat, 19 Oct 2024 17:27:14 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E6=B7=BB=E5=8A=A0=20ws=20=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/trans.sh b/trans.sh index 86b6065..2cd5f8c 100644 --- a/trans.sh +++ b/trans.sh @@ -241,9 +241,14 @@ setup_websocketd() { apk add websocketd wget $confhome/logviewer.html -O /tmp/index.html apk add coreutils + + if [ -z "$web_port" ]; then + web_port=80 + fi + killall websocketd || true # websocketd 遇到 \n 才推送,因此要转换 \r 为 \n - websocketd --loglevel=fatal --staticdir=/tmp \ + websocketd --port "$web_port" --loglevel=fatal --staticdir=/tmp \ stdbuf -oL -eL sh -c "tail -fn+0 /reinstall.log | tr '\r' '\n'" & }