mirror of
https://gitlab.com/CinnamonSlackBuilds/csb.git
synced 2024-12-26 21:59:28 +01:00
04ce3d2a8b
Signed-off-by: Willy Sudiarto Raharjo <willysr@gmail.com>
43 lines
862 B
Bash
43 lines
862 B
Bash
#!/bin/sh
|
|
|
|
start()
|
|
{
|
|
if /usr/bin/sudo -u pulse /usr/bin/pulseaudio --check; then
|
|
echo "pulseaudio is running."
|
|
else
|
|
echo "Starting pulseaudio..."
|
|
/usr/bin/sudo -u pulse /usr/bin/pulseaudio --start --use-pid-file=yes
|
|
fi
|
|
}
|
|
|
|
stop()
|
|
{
|
|
if /usr/bin/sudo -u pulse /usr/bin/pulseaudio --check; then
|
|
printf "Stopping pulseaudio..."
|
|
/usr/bin/sudo -u pulse /usr/bin/pulseaudio --kill
|
|
while /usr/bin/sudo -u pulse /usr/bin/pulseaudio --check; do
|
|
printf "."
|
|
sleep 1
|
|
done
|
|
echo "Done"
|
|
else
|
|
echo "pulseaudio is not running."
|
|
fi
|
|
}
|
|
|
|
status()
|
|
{
|
|
if /usr/bin/sudo -u pulse /usr/bin/pulseaudio --check; then
|
|
echo "pulseaudio is running."
|
|
else
|
|
echo "pulseaudio is not running."
|
|
fi
|
|
}
|
|
|
|
case "$1" in
|
|
'start')start;;
|
|
'stop')stop;;
|
|
'restart')stop;start;;
|
|
'status')status;;
|
|
*)echo "$0 start|stop|restart|status"
|
|
esac
|