]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
shairport-sync: Add initscript
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 11 Nov 2018 18:55:35 +0000 (18:55 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 11 Nov 2018 18:55:35 +0000 (18:55 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/rootfiles/packages/shairport-sync
lfs/shairport-sync
src/initscripts/packages/shairport-sync [new file with mode: 0755]

index d7c2e11d6e43d1e6f4b2825bca995e0876916117..a0cd5c859c3e0e52a8b3b8a628e59d14007adafb 100644 (file)
@@ -1,3 +1,4 @@
+etc/rc.d/init.d/shairport-sync
 etc/shairport-sync.conf
 #etc/shairport-sync.conf.sample
 usr/bin/shairport-sync
 etc/shairport-sync.conf
 #etc/shairport-sync.conf.sample
 usr/bin/shairport-sync
index 2894c7aed71382d1dd56589a66cffeb4b682871f..7703adc9f610031928cc7ec6ab5b27a0b1d13501 100644 (file)
@@ -92,5 +92,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        install -v -m 644 $(DIR_SRC)/config/backup/includes/shairport-sync \
                /var/ipfire/backup/addons/includes/shairport-sync
 
        install -v -m 644 $(DIR_SRC)/config/backup/includes/shairport-sync \
                /var/ipfire/backup/addons/includes/shairport-sync
 
+       # Initscript
+       $(call INSTALL_INITSCRIPT,shairport-sync)
+
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
diff --git a/src/initscripts/packages/shairport-sync b/src/initscripts/packages/shairport-sync
new file mode 100755 (executable)
index 0000000..a5d81a9
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/shairport-sync
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "${1}" in
+       start)
+               boot_mesg "Starting Shairport Sync..."
+               loadproc /usr/bin/shairport-sync --daemon
+               ;;
+
+       stop)
+               boot_mesg "Stopping Shairport Sync..."
+               killproc /usr/bin/shairport-sync
+               ;;
+
+       reload)
+               boot_mesg "Reloading Shairport Sync..."
+               reloadproc /usr/bin/shairport-sync
+               ;;
+
+       restart)
+               ${0} stop
+               sleep 1
+               ${0} start
+               ;;
+
+       status)
+               statusproc /usr/bin/shairport-sync
+               ;;
+
+       *)
+               echo "Usage: ${0} {start|stop|reload|restart|status}"
+               exit 1
+               ;;
+esac
+
+# End $rc_base/init.d/shairport-sync