diff options
author | David Somero <dsomero@hotmail.com> | 2010-05-11 20:01:23 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-11 20:01:23 +0200 |
commit | aceffd1739d64109b74a9a38af1bd017957f7c63 (patch) | |
tree | f758aa7c3eba6e9a3ab628e500f302faa9b8f4c4 /multimedia/mythtv/rc.mythbackend.new | |
parent | 9d0e9de3b65161ebac7781c2b19b698e185deaf7 (diff) | |
download | slackbuilds-aceffd1739d64109b74a9a38af1bd017957f7c63.tar.gz |
multimedia/mythtv: Added to 12.0 repository
Diffstat (limited to 'multimedia/mythtv/rc.mythbackend.new')
-rw-r--r-- | multimedia/mythtv/rc.mythbackend.new | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/multimedia/mythtv/rc.mythbackend.new b/multimedia/mythtv/rc.mythbackend.new new file mode 100644 index 0000000000..5b2cbee30e --- /dev/null +++ b/multimedia/mythtv/rc.mythbackend.new @@ -0,0 +1,55 @@ +#!/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. +# + +# 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 /var/run/mythbackend.pid ]; then + if ! ps axc | grep mythbackend 1> /dev/null 2> /dev/null ; then + echo "Cleaning up old /var/run/mythbackend.pid." + rm -f /var/run/mythbackend.pid + fi + fi + /usr/bin/mythbackend -l /var/log/mythbackend.log -v important,general -p /var/run/mythbackend.pid -d + fi +} + +# Stop mythbackend: +myth_stop() { + # If there is no PID file, ignore this request... + if [ -r /var/run/mythbackend.pid ]; then + killall mythbackend + rm -f /var/run/mythbackend.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 |