From 0c40bef41322e77fbef365270f9bfc3dcf2a1d94 Mon Sep 17 00:00:00 2001 From: Vic Liu Date: Tue, 24 Nov 2020 11:51:45 +0800 Subject: audio/jobs: Use a new audio/detect_sinks_sources as depends job to audio/alsa_record_playback_automated Fixed audio/alsa_record_playback_automated always returns passed result even when there's no valid PulseAudio element. --- bin/pactl_list.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 bin/pactl_list.sh (limited to 'bin') diff --git a/bin/pactl_list.sh b/bin/pactl_list.sh new file mode 100755 index 0000000..a7abb87 --- /dev/null +++ b/bin/pactl_list.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +EXIT_CODE=0 + +for device in "sources" "sinks" +do + if ! pactl list $device short | grep -v -E "monitor|auto_null" + then + echo "No available $device found" + case $device in + "sources") + EXIT_CODE=$(( EXIT_CODE+1 )) + ;; + "sinks") + EXIT_CODE=$(( EXIT_CODE+2 )) + esac + fi +done + +exit $EXIT_CODE \ No newline at end of file -- cgit v1.2.3