From bf72ff2521039aee1a07d703113eca476944c047 Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Sun, 23 Nov 2025 14:18:44 +0800 Subject: [PATCH] feat(install): add config validation checks for uuid and file integrity - Added comments for clarity on config file existence and blank checks - Included UUID validation to prevent uninitialized config usage - Improves robustness by prompting users to create proper configs upfront --- install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install.sh b/install.sh index 45a77c7..64836ea 100644 --- a/install.sh +++ b/install.sh @@ -8,10 +8,17 @@ restart_docker(){ check_config(){ + # 如果配置文件不存在或者空白 if [ ! -e "$config_dir/config.json" ] || [ ! -s "$config_dir/config.json" ];then echo "请先'创建配置'" exit 0 fi + # 如果配置未初始化 + uuid=$(jq -r '.inbounds[0].settings.clients[0].id' "$config_dir/config.json") + if [ "$uuid" = "你的UUID" ] || [ -z "$uuid" ]; then + echo "请先'创建配置'" + exit 0 + fi }