Skip to content
Snippets Groups Projects
Commit 0f83c180 authored by TIS's avatar TIS
Browse files

add checks for pulseaudio - sometimes doesn't start, so retry

parent ad193d2d
Branches
No related tags found
No related merge requests found
#!/bin/sh
#!/bin/bash
pulseaudio --start -vvv --disallow-exit --log-target=syslog --high-priority --exit-idle-time=-1 --daemonize
if pulseaudio --check ; then
echo "Pulseaudio already running - killing it..."
pulseaudio --kill
fi
exec "$@"
\ No newline at end of file
# sometimes pulseaudio fails to start (for unknown reason - try starting it again)
p=0
while ! pulseaudio --check && [ $p -lt 2 ] ; do
echo "Starting pulseaudio..."
pulseaudio --start -vvv --disallow-exit --log-target=syslog --high-priority --exit-idle-time=-1 &
i=0
while ! pulseaudio --check && [ $i -lt 3 ] ; do
echo "Waiting for pulseaudio to start..."
sleep 1
i=$((i+1))
done
p=$((p+1))
done
if pulseaudio --check ; then
exec "$@"
else
echo "Error starting pulseaudio"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment