summaryrefslogtreecommitdiff
path: root/package/shairport-sync/files/shairport-sync.init
diff options
context:
space:
mode:
Diffstat (limited to 'package/shairport-sync/files/shairport-sync.init')
-rw-r--r--package/shairport-sync/files/shairport-sync.init28
1 files changed, 28 insertions, 0 deletions
diff --git a/package/shairport-sync/files/shairport-sync.init b/package/shairport-sync/files/shairport-sync.init
new file mode 100644
index 000000000..c9bcb92bf
--- /dev/null
+++ b/package/shairport-sync/files/shairport-sync.init
@@ -0,0 +1,28 @@
+#!/bin/sh
+#PKG shairport-sync
+#INIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${shairport_sync:-NO}" = x"NO" && exit 0
+ test x"$shairport_sync" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
+ exec sh $0 start
+ ;;
+start)
+ /usr/bin/shairport-sync -c /etc/shairport/shairport-sync.conf -d $shairport_sync_flags
+ ;;
+stop)
+ /usr/bin/shairport-sync -k
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?