diff --git a/scripts/install-debros-network.sh b/scripts/install-debros-network.sh index ca64dfa..4427086 100755 --- a/scripts/install-debros-network.sh +++ b/scripts/install-debros-network.sh @@ -22,11 +22,18 @@ RQLITE_NODE_PORT="5002" RAFT_BOOTSTRAP_PORT="7001" RAFT_NODE_PORT="7002" UPDATE_MODE=false +NON_INTERACTIVE=false log() { echo -e "${CYAN}[$(date '+%Y-%m-%d %H:%M:%S')]${NOCOLOR} $1" } +# Check if running non-interactively (piped from curl) +if [ ! -t 0 ]; then + NON_INTERACTIVE=true + log "Running in non-interactive mode" +fi + error() { echo -e "${RED}[ERROR]${NOCOLOR} $1" } @@ -100,6 +107,12 @@ check_existing_installation() { log "Node service is currently running" fi + if [ "$NON_INTERACTIVE" = true ]; then + log "Non-interactive mode: updating existing installation" + UPDATE_MODE=true + return 0 + fi + echo -e "${YELLOW}Existing installation detected!${NOCOLOR}" echo -e "${CYAN}Options:${NOCOLOR}" echo -e "${CYAN}1) Update existing installation${NOCOLOR}" @@ -369,6 +382,18 @@ configuration_wizard() { log "${GREEN} DeBros Network Configuration Wizard ${NOCOLOR}" log "${BLUE}==================================================${NOCOLOR}" + if [ "$NON_INTERACTIVE" = true ]; then + log "Non-interactive mode: using default configuration" + NODE_TYPE="bootstrap" + SOLANA_WALLET="11111111111111111111111111111111" # Placeholder wallet + CONFIGURE_FIREWALL="yes" + log "Node Type: $NODE_TYPE" + log "Installation Directory: $INSTALL_DIR" + log "Firewall Configuration: $CONFIGURE_FIREWALL" + success "Configuration completed with defaults" + return 0 + fi + # Node type selection while true; do echo -e "${GREEN}Select node type:${NOCOLOR}"