Browse Source

add startup script for tvheadend

Waldemar Brodkorb 9 years ago
parent
commit
55121d8bb9

+ 1 - 1
package/tvheadend/Makefile

@@ -5,7 +5,7 @@ include $(ADK_TOPDIR)/rules.mk
 
 PKG_NAME:=		tvheadend
 PKG_VERSION:=		679b7797128b8979145dc2a0a3c54ea513a0466b
-PKG_RELEASE:=		1
+PKG_RELEASE:=		2
 PKG_DESCR:=		tv streaming server
 PKG_SECTION:=		mm/video
 PKG_BUILDDEP:=		openssl

+ 29 - 0
package/tvheadend/files/tvheadend.init

@@ -0,0 +1,29 @@
+#!/bin/sh
+#PKG tvheadend 
+#INIT 90
+
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+	test x"${tvheadend:-NO}" = x"NO" && exit 0
+	test x"$tvheadend" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
+	exec sh $0 start
+	;;
+start)
+	tvheadend &
+	;;
+stop)
+	kill $(pgrep -f /usr/bin/tvheadend)
+	;;
+restart)
+	sh $0 stop
+	sh $0 start
+	;;
+*)
+	echo "Usage: $0 {start | stop | restart}"
+	exit 1
+	;;
+esac
+exit $?

+ 3 - 0
package/tvheadend/files/tvheadend.postinst

@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf tvheadend NO