mirror of
https://github.com/wnlen/clash-for-linux.git
synced 2026-02-04 10:11:28 +08:00
Update start.sh
This commit is contained in:
5
start.sh
5
start.sh
@ -68,7 +68,12 @@ fi
|
|||||||
|
|
||||||
# 兜底生成随机 secret
|
# 兜底生成随机 secret
|
||||||
if [ -z "$Secret" ]; then
|
if [ -z "$Secret" ]; then
|
||||||
|
if command -v openssl >/dev/null 2>&1; then
|
||||||
Secret="$(openssl rand -hex 32)"
|
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
|
fi
|
||||||
|
|
||||||
# 强制写入 secret 到指定配置文件(存在则替换,不存在则追加)
|
# 强制写入 secret 到指定配置文件(存在则替换,不存在则追加)
|
||||||
|
|||||||
Reference in New Issue
Block a user