sleep 1 second before setting default sink to avoid timing issues
This commit is contained in:
parent
8680811bfd
commit
a6218a0d96
@ -1,4 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
# shellcheck disable=SC2154
|
||||||
# Setup and run encrypted connection to remote PulseAudio/Pipewire server
|
# Setup and run encrypted connection to remote PulseAudio/Pipewire server
|
||||||
# Copyright (C) 2023 Tilman Kranz <t.kranz@tk-sls.de>
|
# Copyright (C) 2023 Tilman Kranz <t.kranz@tk-sls.de>
|
||||||
#
|
#
|
||||||
@ -179,7 +181,7 @@ EOF
|
|||||||
# Check if SSH port forwarding is running
|
# Check if SSH port forwarding is running
|
||||||
check_pa_ssh() {
|
check_pa_ssh() {
|
||||||
for pid in $(pidof ssh) ; do
|
for pid in $(pidof ssh) ; do
|
||||||
if grep -Fq $USER-pulseaudio /proc/"$pid"/cmdline ; then
|
if grep -Fq "$USER"-pulseaudio /proc/"$pid"/cmdline ; then
|
||||||
grep -Fq -e -L /proc/"$pid"/cmdline || {
|
grep -Fq -e -L /proc/"$pid"/cmdline || {
|
||||||
echo "ERROR: No SSH port forwarding to remote server is established." >&2
|
echo "ERROR: No SSH port forwarding to remote server is established." >&2
|
||||||
return 1 ;
|
return 1 ;
|
||||||
@ -307,6 +309,7 @@ do_start() {
|
|||||||
|
|
||||||
if "$outbound" ; then
|
if "$outbound" ; then
|
||||||
enable_local_pa_tunnel_sink || return 1
|
enable_local_pa_tunnel_sink || return 1
|
||||||
|
sleep 1
|
||||||
set_local_pa_tunnel_sink_as_default || return 1
|
set_local_pa_tunnel_sink_as_default || return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -382,7 +385,7 @@ disable_remote_pa_tunnel_server() {
|
|||||||
# Terminate SSH portforwarding session
|
# Terminate SSH portforwarding session
|
||||||
terminate_ssh_portforward() {
|
terminate_ssh_portforward() {
|
||||||
for pid in $(pidof ssh) ; do
|
for pid in $(pidof ssh) ; do
|
||||||
if grep -Fq $USER-pulseaudio /proc/"$pid"/cmdline ; then
|
if grep -Fq "$USER"-pulseaudio /proc/"$pid"/cmdline ; then
|
||||||
kill -TERM "$pid"
|
kill -TERM "$pid"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user