core: 日志网址使用随机路径

This commit is contained in:
bin456789
2026-09-06 11:31:38 +08:00
parent 388bf257e9
commit d44c2017fd
4 changed files with 32 additions and 12 deletions
+5 -3
View File
@@ -188,14 +188,16 @@ d-i preseed/early_command string true; \
} >>/etc/motd; \
mem=$(grep ^MemTotal: /proc/meminfo | { read -r _ y _; echo "$((y / 1024))"; }); \
if command -v websocketd && [ "$mem" -ge 400 ]; then \
mkdir -p /tmp/web; \
echo 'Wrong Path' >/tmp/web/index.html; \
for _ in {1..10}; do \
if wget "$confhome/logviewer.html" -O /tmp/index.html; then \
if wget "$confhome/logviewer.html" -O /tmp/web$web_path; then \
break; \
fi; \
sleep 5; \
done; \
run_as_service_with_screen websocketd --port "$web_port" --loglevel=fatal --staticdir=/tmp \
sh -c "tail -fn+0 /var/log/syslog | tr '\r' '\n' | grep -Fiv -e password -e token" ; \
run_as_service_with_screen websocketd --port "$web_port" --loglevel=fatal --staticdir=/tmp/web \
sh -c "if [ \"\$PATH_INFO\" = \"$web_path\" ]; then tail -fn+0 /var/log/syslog | tr '\r' '\n' | grep -Fiv -e password -e token; fi" ; \
fi; \
fi; \