Ticket #7580: my.rc.backend

File my.rc.backend, 1.1 KB (added by anonymous, 10 years ago)
Line 
1#!/bin/sh
2# made for slackware by Kemble Wagner but should work on any distro
3#if mythbackend starting on startup with problems like below
4# e.g +environment variable HOME or MYTHCONFDIR
5# Failed to init MythContext, exiting
6# then uncomment the line below to export you myth users home folder make sure you edit the path
7# export MYTHCONFDIR=/home/user/.mythtv
8
9
10
11mythbackend_start(){
12if ! ps axc | grep mythbackend 1> /dev/null 2> /dev/null; then
13echo  "Starting mythbackend"
14        /usr/local/bin/mythbackend -l /var/log/backend.log -v important,general -p /var/run/mythtv/mythbackend.pid -d
15else
16echo  "mythbackend already running"
17 fi 
18}
19mythbackend_stop(){
20        echo  "Stopping mythbackend"
21        /bin/killall -9 mythbackend
22}
23
24mythbackend_restart(){
25        mythbackend_stop
26        /usr/bin/sleep 2
27        mythbackend_start
28}
29case "$1" in
30        'start')
31        mythbackend_start
32        ;;
33
34        'stop')
35        mythbackend_stop
36        ;;
37
38        'restart')
39        mythbackend_restart
40        ;;
41
42        *)
43        echo "usage $0 start|stop|restart"
44esac
45