summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythbackend.sh
diff options
context:
space:
mode:
Diffstat (limited to 'abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythbackend.sh')
-rwxr-xr-xabs/mv-core/myth/release-fixes/mythtv-release-fixes/mythbackend.sh117
1 files changed, 117 insertions, 0 deletions
diff --git a/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythbackend.sh b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythbackend.sh
new file mode 100755
index 0000000..e7a7b70
--- /dev/null
+++ b/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythbackend.sh
@@ -0,0 +1,117 @@
+#!/bin/bash
+#
+# /etc/rc.d/init.d/mythbackend
+#
+# Starts the mythbackend as a daemon
+#
+# chkconfig: 345 90 10
+# description: Starts the mythbackend process as a daemon after the XWindows \
+# system is started, in runlevel 5. This allows scheduled \
+# recordings to occur without manual intervention.
+# processname: mythbackend
+
+# Copyright (c) by Michael Thomson <linux at m-thomson dot net>
+# With thanks to Stu Tomlinson <stu at nosnilmot dot com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Default values to use if none are supplied in the config file.
+# User who should start the mythbackend processes
+MBE_USER="root"
+# Directory holding the mythbackend binary
+MBE_LOCATION="/usr/local/bin/"
+# Name of mythbackend binary
+MBE_PROG="mythbackend"
+# Full path to mythbackend log file
+MBE_LOGFILE="/var/log/mythtv/mythbackend.log"
+
+# Source function library.
+. /etc/init.d/functions
+
+# Source config file if available
+if [ -f "/etc/sysconfig/mythbackend" ]; then
+ . /etc/sysconfig/mythbackend
+fi
+
+test -x ${MBE_LOCATION}${MBE_PROG} || exit 0
+
+RETVAL=0
+
+#
+# See how we were called.
+#
+
+start() {
+ # Check if mythbackend is already running
+ if [ ! -f /var/lock/subsys/${MBE_PROG} ]; then
+ echo -n "Starting ${MBE_PROG}: "
+ # /usr/local/bin/mythbackend -d -l /some/log/file
+ #daemon --user ${MBE_USER} ${MBE_LOCATION}${MBE_PROG} -d -l ${MBE_LOGFILE}
+ ${MBE_LOCATION}${MBE_PROG} -d -l ${MBE_LOGFILE}
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/${MBE_PROG}
+ echo
+ fi
+ return $RETVAL
+}
+
+stop() {
+ echo -n "Stopping ${MBE_PROG}: "
+ killproc ${MBE_LOCATION}${MBE_PROG}
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${MBE_PROG}
+ echo
+ return $RETVAL
+}
+
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ restart
+}
+
+status_at() {
+ status ${MBE_LOCATION}${MBE_PROG}
+}
+
+case "$1" in
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+reload|restart)
+ restart
+ ;;
+condrestart)
+ if [ -f /var/lock/subsys/${MBE_PROG} ]; then
+ restart
+ fi
+ ;;
+status)
+ status_at
+ ;;
+*)
+ echo "Usage: $0 {start|stop|restart|condrestart|status}"
+ exit 1
+esac
+
+exit $?
+exit $RETVAL