feat: implement smart IP detection and automated configuration
This commit is contained in:
parent
a2500607ee
commit
13e68be5ee
8
configure
vendored
8
configure
vendored
@ -398,6 +398,14 @@ function check_ipaddr(){
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# multiple IP detected, try to find the "best" one (non-docker, non-loopback)
|
||||||
|
local best_ip=$(hostname --all-ip-addresses | tr ' ' '\n' | grep -vE '^(127\.|172\.(1[6-9]|2[0-9]|3[01])\.|169\.254\.)' | head -n1)
|
||||||
|
if [[ -n "${best_ip}" && ${interactive} != "true" ]]; then
|
||||||
|
log_info "primary_ip = ${best_ip} (auto-selected from multiple)"
|
||||||
|
PRIMARY_IP=${best_ip}
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
# multiple IP detected
|
# multiple IP detected
|
||||||
log_warn "Multiple IP address candidates found:"
|
log_warn "Multiple IP address candidates found:"
|
||||||
list_ipaddr
|
list_ipaddr
|
||||||
|
|||||||
@ -106,8 +106,13 @@ else
|
|||||||
echo -e "${RED}Warning: Primary setup scripts not found! Check repo content.${NC}"
|
echo -e "${RED}Warning: Primary setup scripts not found! Check repo content.${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN}Installation successful!${NC}"
|
# Run Configure automatically
|
||||||
|
if [ -f "./configure" ]; then
|
||||||
|
echo -e "${BLUE}Running configure (auto-detecting IP)...${NC}"
|
||||||
|
./configure -n || { echo -e "${RED}Error: Configure failed${NC}"; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${GREEN}Installation and configuration successful!${NC}"
|
||||||
echo -e "Next steps:"
|
echo -e "Next steps:"
|
||||||
echo -e " cd ${INSTALL_DIR}"
|
echo -e " cd ${INSTALL_DIR}"
|
||||||
echo -e " ./configure # Generate config"
|
echo -e " ./deploy.yml # Run this to start the actual deployment"
|
||||||
echo -e " ./deploy.yml # Install"
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user