forked-daapd became owntone
[portage-squeep] / media-sound / owntone / files / daapd.initd
diff --git a/media-sound/owntone/files/daapd.initd b/media-sound/owntone/files/daapd.initd
new file mode 100644 (file)
index 0000000..083f56c
--- /dev/null
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+
+# Override in /etc/conf.d/owntone
+LOG_LEVEL=${LOG_LEVEL:-2}
+LOG_DOMAINS=${LOG_DOMAINS:-'main,mdns,db,scan'}
+FFID=${FFID:-owntone}
+
+PIDFILE=/run/owntone.pid
+
+depend() {
+    need avahi-dnsconfd
+}
+
+start() {
+    ebegin "Starting owntone"
+    start-stop-daemon --start owntone \
+                     --pidfile "$PIDFILE" \
+                     -- \
+                     -P "$PIDFILE" \
+                     -d "$LOG_LEVEL" \
+                     -b "$FFID" \
+                     -D "$LOG_DOMAINS"
+    eend $?
+}
+
+stop() {
+    ebegin "Stopping daapd"
+    start-stop-daemon --stop owntone \
+                     --pidfile "$PIDFILE"
+    eend $?
+}