#!/bin/bash REQUIRED_PORTS=( "sanctuary_out:left" "sanctuary_out:right" "prayer_out:left" "prayer_out:right" "Macbook_out:left" "Macbook_out:right" "Praise:left" "Praise:right" "Worship:left" "Worship:right" "Instrumental:left" "Instrumental:right" ) DEADLINE=$((SECONDS + 10)) while [ $SECONDS -lt $DEADLINE ]; do ALL_FOUND=true for PORT in "${REQUIRED_PORTS[@]}"; do if ! /usr/bin/jack_lsp | grep -q "$PORT"; then ALL_FOUND=false break fi done if $ALL_FOUND; then echo "All required JACK ports found." exit 0 fi sleep 0.5 done echo "Timeout waiting for JACK ports" exit 1