#!/bin/bash while true; do foo=`pactl list sources short| grep -q ZOOM && echo "found"`; if [ ! -z "$foo" ]; then echo "audio device is found all groovy" if pidof -x "liquidsoap" >/dev/null; then echo "stream is happy" else echo "steam not happy - staring stream script again" ./start-stream-in-screen.sh & fi else echo "run some script to restart the audio" killall /usr/bin/liquidsoap pulseaudio -k && sudo alsa force-reload fi sleep 2 done