From 77e39d4cdbb797828592ad7796091bd8bbd8c8af Mon Sep 17 00:00:00 2001 From: CN-JS-HuiBai Date: Wed, 15 Apr 2026 16:24:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=89=E8=A3=85=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E7=9A=84=E5=9F=BA=E6=9C=AC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/install.sh b/install.sh index a741d9ce..99f26389 100644 --- a/install.sh +++ b/install.sh @@ -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