#!/bin/bash

# Start the first process
echo "Auto connecting PipeWire ports..."
/usr/bin/wpexec /etc/wireplumber/scripts/auto-connect-ports.lua &

# Start the second process
echo "Starting pw-jack..."
cd src && /usr/bin/pw-jack /usr/bin/liquidsoap ./engine.liq &

# Wait for any process to exit
wait -n

# Exit with status of process that exited first
exit $?