[SCM] Mumudvb packaging branch, upstream, updated. 24c2efb080b56abb8e7be67bae30ba7fe457759e

Brice DUBOST braice at braice.net
Sat Nov 1 13:31:06 UTC 2008


The following commit has been merged in the upstream branch:
commit a7b2dc3059dc112ac430ce001ab51191bc1e3802
Author: Brice DUBOST <braice at braice.net>
Date:   Sun Oct 26 20:44:20 2008 +0100

    Initial import for mumudvb init script

diff --git a/scripts/README b/scripts/README
new file mode 100644
index 0000000..1888db9
--- /dev/null
+++ b/scripts/README
@@ -0,0 +1,4 @@
+Startup scripts for mumudvb
+
+This script expect to find /etc/mumudvb/mumudvb.conf, with the syntax specified in the example file
+
diff --git a/scripts/mumudvb.conf b/scripts/mumudvb.conf
new file mode 100644
index 0000000..151855e
--- /dev/null
+++ b/scripts/mumudvb.conf
@@ -0,0 +1,13 @@
+#Mumudvb init config file
+#
+# This file is used to specify the locations of mumudvb config files for each card
+#
+
+#Change this line to reflect your configuration
+#Ex : ADAPTERS="0 1 2 4"
+ADAPTERS="0"
+
+#Location of the config files
+#Ex : MUMUDVB_CONF_1="/etc/mumudvb/card1.conf"
+MUMUDVB_CONF_0="/etc/mumudvb/to_be_configured.conf"
+
diff --git a/scripts/mumudvb.init b/scripts/mumudvb.init
new file mode 100644
index 0000000..527f883
--- /dev/null
+++ b/scripts/mumudvb.init
@@ -0,0 +1,86 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          mumudvb
+# Required-Start:    $local_fs $network $syslog
+# Required-Stop:     
+# Default-Start:     S
+# Default-Stop:      
+# Short-Description: mumudvb
+# Description:       Digital television streaming program
+### END INIT INFO
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/bin/mumudvb
+DAEMON_OPTS=" -c "
+PIDDIR=/var/run/mumudvb
+NAME=Mumudvb
+DAEMONUSER=root
+
+#Reading of the config file
+if [ -f /etc/mumudvb/mumudvb.conf ] ; then
+        . /etc/mumudvb/mumudvb.conf
+fi
+
+
+. /lib/lsb/init-functions
+
+test -x $DAEMON || exit 0
+
+set -e
+
+do_start() {
+        if [ ! -d $PIDDIR ]; then
+                mkdir -p $PIDDIR
+        fi
+        chown $DAEMONUSER:$DAEMONUSER $PIDDIR
+	for ADAPTER in $ADAPTERS; do
+		#Todo : add mumudvb opts
+		#Todo : fails if all card fails
+		log_daemon_msg "\t Card $ADAPTER"
+		eval CONFIG_FILE=\$MUMUDVB_CONF_$ADAPTER 
+		if [ ! -f $CONFIG_FILE ]; then
+                   log_warning_msg "\t\tConfig file $CONFIG_FILE not found."
+		else
+		   start-stop-daemon --start --oknodo --pidfile "$PIDDIR/mumudvb_carte$PIDFILE.pid" \
+               		 --exec $DAEMON -- $DAEMON_OPTS $CONFIG_FILE
+		fi
+	done
+}
+
+do_stop() {
+	for PIDFILE in `ls $PIDDIR/mumudvb_carte*.pid 2> /dev/null`; do
+	        start-stop-daemon --stop --oknodo --quiet --pidfile "$PIDDIR/mumudvb_carte$PIDFILE.pid" \
+        	        --exec $DAEMON 
+	done
+}
+
+case "$1" in
+  start)
+        if [ ! -f /etc/mumudvb/mumudvb.conf ]; then
+                log_failure_msg "/etc/mumudvb/mumudvb.conf not found, Can't start $NAME"
+                exit 0
+        fi
+        
+        log_daemon_msg "Starting $NAME"
+        do_start
+        log_end_msg $?
+        ;;
+  stop)
+        log_daemon_msg "Stopping $NAME"
+        do_stop
+        log_end_msg $?
+        ;;
+  restart|force-reload)
+        log_daemon_msg "Restarting $NAME"
+        do_stop
+        sleep 1
+        do_start
+        log_end_msg $?
+        ;;
+  *)
+        log_success_msg "Usage: $0 {start|stop|restart|force-reload}" >&2
+        exit 1
+        ;;
+esac
+
+exit 0

-- 
Mumudvb packaging



More information about the pkg-vdr-dvb-changes mailing list