summaryrefslogtreecommitdiff
path: root/package/pulseaudio/files/pulseaudio.init
diff options
context:
space:
mode:
Diffstat (limited to 'package/pulseaudio/files/pulseaudio.init')
-rw-r--r--package/pulseaudio/files/pulseaudio.init32
1 files changed, 32 insertions, 0 deletions
diff --git a/package/pulseaudio/files/pulseaudio.init b/package/pulseaudio/files/pulseaudio.init
new file mode 100644
index 000000000..029174628
--- /dev/null
+++ b/package/pulseaudio/files/pulseaudio.init
@@ -0,0 +1,32 @@
+#!/bin/sh
+#PKG pulseaudio
+#INIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${pulseaudio:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ if [ ! -d /var/run/pulse ]; then
+ mkdir -p /var/run/pulse && chown pulse.pulse /var/run/pulse && chmod 750 /var/run/pulse
+ fi
+ if [ ! -d /var/lib/pulse ]; then
+ mkdir -p /var/lib/pulse && chown pulse.pulse /var/lib/pulse && chmod 750 /var/lib/pulse
+ fi
+ /usr/bin/pulseaudio $pulseaudio_flags
+ ;;
+stop)
+ kill $(pgrep -f /usr/bin/pulseaudio)
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?