优化安装逻辑
This commit is contained in:
4
.env.example
Normal file
4
.env.example
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# sing-box Xboard Node Configuration
|
||||||
|
PANEL_URL=https://your-panel.com
|
||||||
|
PANEL_TOKEN=your_node_key
|
||||||
|
NODE_ID=1
|
||||||
17
install.sh
17
install.sh
@@ -113,10 +113,21 @@ build_sing_box() {
|
|||||||
install_go
|
install_go
|
||||||
build_sing_box
|
build_sing_box
|
||||||
|
|
||||||
|
# Load .env if exists
|
||||||
|
if [[ -f ".env" ]]; then
|
||||||
|
echo -e "${YELLOW}Loading configuration from .env...${NC}"
|
||||||
|
source .env
|
||||||
|
fi
|
||||||
|
|
||||||
# Interactive Prompts
|
# Interactive Prompts
|
||||||
read -p "Enter Panel URL (e.g., https://yourbase.com): " PANEL_URL
|
read -p "Enter Panel URL [${PANEL_URL}]: " INPUT_URL
|
||||||
read -p "Enter Node ID: " NODE_ID
|
PANEL_URL=${INPUT_URL:-$PANEL_URL}
|
||||||
read -p "Enter Panel Token (Node Key): " PANEL_TOKEN
|
|
||||||
|
read -p "Enter Node ID [${NODE_ID}]: " INPUT_ID
|
||||||
|
NODE_ID=${INPUT_ID:-$NODE_ID}
|
||||||
|
|
||||||
|
read -p "Enter Panel Token (Node Key) [${PANEL_TOKEN}]: " INPUT_TOKEN
|
||||||
|
PANEL_TOKEN=${INPUT_TOKEN:-$PANEL_TOKEN}
|
||||||
|
|
||||||
if [[ -z "$PANEL_URL" || -z "$NODE_ID" || -z "$PANEL_TOKEN" ]]; then
|
if [[ -z "$PANEL_URL" || -z "$NODE_ID" || -z "$PANEL_TOKEN" ]]; then
|
||||||
echo -e "${RED}All fields are required!${NC}"
|
echo -e "${RED}All fields are required!${NC}"
|
||||||
|
|||||||
Reference in New Issue
Block a user