update install.sh to check for MQTT brokers in .env.local

This commit is contained in:
agessaman 2025-10-14 21:29:30 -07:00
parent ebf4745c71
commit 56d5bee88e

View file

@ -1382,9 +1382,17 @@ main() {
else
print_info "Keeping existing configuration"
# Check if MQTT brokers are already configured
if grep -q "^PACKETCAPTURE_MQTT[1-4]_ENABLED=true" "$INSTALL_DIR/.env.local" 2>/dev/null; then
if [ -f "$INSTALL_DIR/.env.local" ] && grep -q "^PACKETCAPTURE_MQTT[1-4]_ENABLED=true" "$INSTALL_DIR/.env.local" 2>/dev/null; then
print_info "MQTT brokers already configured - skipping MQTT configuration"
else
# Debug: Show what we're checking
if [ -f "$INSTALL_DIR/.env.local" ]; then
print_info "Checking for MQTT brokers in: $INSTALL_DIR/.env.local"
print_info "Found MQTT lines:"
grep "^PACKETCAPTURE_MQTT[1-4]_ENABLED=" "$INSTALL_DIR/.env.local" 2>/dev/null || echo " (none found)"
else
print_info "Configuration file not found: $INSTALL_DIR/.env.local"
fi
# Still need to configure MQTT brokers if not already configured
configure_mqtt_brokers_only
fi