From e5efca95d0735c3533ebc22d5c2d9f4e6561a746 Mon Sep 17 00:00:00 2001 From: wnlen <62139570+wnlen@users.noreply.github.com> Date: Thu, 15 Jan 2026 00:32:19 +0800 Subject: [PATCH] Update start.sh --- start.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 11044f5..1071e2f 100644 --- a/start.sh +++ b/start.sh @@ -68,7 +68,12 @@ fi # 兜底生成随机 secret if [ -z "$Secret" ]; then - Secret="$(openssl rand -hex 32)" + if command -v openssl >/dev/null 2>&1; then + Secret="$(openssl rand -hex 32)" + else + # 32 bytes -> 64 hex chars + Secret="$(head -c 32 /dev/urandom | od -An -tx1 | tr -d ' \n')" + fi fi # 强制写入 secret 到指定配置文件(存在则替换,不存在则追加)