#!/bin/sh sleep 3 source_name="master-mono" source_position=1 if [ "$(cat /etc/hostname)" = "work-01" ]; then source_position=2 fi source_index=$(pactl list short sources | grep "input.*pci-" | head -n 1 | head -n "${source_position}" | awk '{print $1;}') echo "${source_index}" pactl load-module module-echo-cancel \ "source_name=${source_name}" \ "master=${source_index}" \ use_master_format=1 \ aec_method="webrtc" \ aec_args='"beamforming=1 mic_geometry=-0.04,0,0,0.04,0,0"' pactl set-default-source "${source_name}"