修改安装脚本的基本逻辑

This commit is contained in:
CN-JS-HuiBai
2026-04-15 16:24:16 +08:00
parent 98f3974260
commit 77e39d4cdb

View File

@@ -152,18 +152,11 @@ PANEL_TOKEN=${INPUT_TOKEN:-$PANEL_TOKEN}
read -p "This node is behind an L4 proxy/LB that sends PROXY protocol? [${ENABLE_PROXY_PROTOCOL_HINT:-n}]: " INPUT_PROXY_PROTOCOL
ENABLE_PROXY_PROTOCOL_HINT=${INPUT_PROXY_PROTOCOL:-${ENABLE_PROXY_PROTOCOL_HINT:-n}}
read -p "Enter Node Count [${NODE_COUNT:-1}]: " INPUT_COUNT
NODE_COUNT=${INPUT_COUNT:-${NODE_COUNT:-1}}
if ! [[ "$NODE_COUNT" =~ ^[0-9]+$ ]] || [[ "$NODE_COUNT" -lt 1 ]]; then
echo -e "${RED}Node Count must be a positive integer${NC}"
exit 1
fi
declare -a NODE_IDS
declare -a NODE_TAGS
for ((i=1; i<=NODE_COUNT; i++)); do
i=1
while true; do
DEFAULT_NODE_ID=""
DEFAULT_NODE_TAG=""
if [[ "$i" -eq 1 && -n "$NODE_ID" ]]; then
@@ -179,8 +172,16 @@ for ((i=1; i<=NODE_COUNT; i++)); do
CURRENT_NODE_TAG=${INPUT_TAG:-$DEFAULT_NODE_TAG}
NODE_IDS+=("$CURRENT_NODE_ID")
NODE_TAGS+=("$CURRENT_NODE_TAG")
read -p "Add another node? [y/N]: " INPUT_ADD_ANOTHER
if [[ ! "$INPUT_ADD_ANOTHER" =~ ^([yY][eE][sS]|[yY]|1|true|TRUE)$ ]]; then
break
fi
((i++))
done
NODE_COUNT=${#NODE_IDS[@]}
# Sync time (Critical for SS 2022)
echo -e "${YELLOW}Syncing system time...${NC}"
timedatectl set-ntp true || true