diff --git a/install.sh b/install.sh index a3ad2895..2a3aa5ff 100644 --- a/install.sh +++ b/install.sh @@ -33,19 +33,6 @@ case $ARCH in *) echo -e "${RED}Unsupported architecture: $ARCH${NC}"; exit 1 ;; esac -# Interactive Prompts -read -p "Enter Panel URL (e.g., https://yourbase.com): " PANEL_URL -read -p "Enter Node ID: " NODE_ID -read -p "Enter Panel Token (Node Key): " PANEL_TOKEN - -if [[ -z "$PANEL_URL" || -z "$NODE_ID" || -z "$PANEL_TOKEN" ]]; then - echo -e "${RED}All fields are required!${NC}" - exit 1 -fi - -# Clean up trailing slash -PANEL_URL="${PANEL_URL%/}" - # Prepare directories mkdir -p "$CONFIG_DIR" mkdir -p "/var/lib/sing-box" @@ -126,6 +113,19 @@ build_sing_box() { install_go build_sing_box +# Interactive Prompts +read -p "Enter Panel URL (e.g., https://yourbase.com): " PANEL_URL +read -p "Enter Node ID: " NODE_ID +read -p "Enter Panel Token (Node Key): " PANEL_TOKEN + +if [[ -z "$PANEL_URL" || -z "$NODE_ID" || -z "$PANEL_TOKEN" ]]; then + echo -e "${RED}All fields are required!${NC}" + exit 1 +fi + +# Clean up trailing slash +PANEL_URL="${PANEL_URL%/}" + # Generate Configuration echo -e "${YELLOW}Generating configuration...${NC}" cat > "$CONFIG_FILE" <