diff options
author | David Somero <dsomero@hotmail.com> | 2010-08-14 08:52:50 -0500 |
---|---|---|
committer | Erik Hanson <erik@slackbuilds.org> | 2010-08-14 19:04:50 -0500 |
commit | 5eae1ee8d02db1aa61ceb72017f6f117b20792d3 (patch) | |
tree | f24f8c290135dfdef529b7b3544f22544d6249e5 /multimedia/mythtv/files/rc.mythbackend.new | |
parent | 286ba92326f78d599f6bae45135fbaef7a041768 (diff) | |
download | slackbuilds-5eae1ee8d02db1aa61ceb72017f6f117b20792d3.tar.gz |
multimedia/mythtv: Updated for version 0.23.1.
Signed-off-by: Erik Hanson <erik@slackbuilds.org>
Diffstat (limited to 'multimedia/mythtv/files/rc.mythbackend.new')
-rw-r--r-- | multimedia/mythtv/files/rc.mythbackend.new | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/multimedia/mythtv/files/rc.mythbackend.new b/multimedia/mythtv/files/rc.mythbackend.new new file mode 100644 index 0000000000..c4d1ce1ef6 --- /dev/null +++ b/multimedia/mythtv/files/rc.mythbackend.new @@ -0,0 +1,62 @@ +#!/bin/sh +# Start/stop/restart mythbackend +# +# Modification done by Benoit Beauchamp, based on rc.mysqld by +# +# Copyright 2003 Patrick J. Volkerding, Concord, CA +# Copyright 2003 Slackware Linux, Inc., Concord, CA +# +# This program comes with NO WARRANTY, to the extent permitted by law. +# You may redistribute copies of this program under the terms of the +# GNU General Public License. +# +LOG=/var/log/mythbackend.log +PID=/var/run/mythbackend.pid +MYTHTV_HOME=/etc/mythtv +export MYTHCONFDIR="$MYTHTV_HOME" +export HOME="$MYTHTV_HOME" + +# Start mythbackend: +myth_start() { + if [ -x /usr/bin/mythbackend ]; then + # If there is an old PID file (no mythbackend running), clean it up: + if [ -r $PID ]; then + if ! ps axc | grep mythbackend 1> /dev/null 2> /dev/null ; then + echo "Cleaning up old $PID." + rm -f $PID + fi + fi + echo "Starting mythbackend..." + /usr/bin/mythbackend -l $LOG -v important,general -p $PID -d + fi +} + +# Stop mythbackend: +myth_stop() { + # If there is no PID file, ignore this request... + if [ -r $PID ]; then + echo "Stopping mythbackend..." + killall mythbackend + rm -f $PID + fi +} + +# Restart mythbackend: +myth_restart() { + myth_stop + myth_start +} + +case "$1" in +'start') + myth_start + ;; +'stop') + myth_stop + ;; +'restart') + myth_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac |