summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/lh_backend_control.sh
blob: 4b0f18494707784555584cd10e0173acdb57aab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
#  This script is used to start stop the backend.
#  Intended to be used via hotkeys.


MYTH_RUN_STATUS="1"
. /etc/profile
. /etc/systemconfig


if [ -e /etc/X11/WINDOWMANAGER ]
then
    . /etc/X11/WINDOWMANAGER
fi

MV_BEC="/usr/MythVantage/bin/backend_control.sh"

case $1 in
    stop)
        if [ x$STARTUP_STYLE = xenhanced ]
        then
            #/usr/MythVantage/bin/mythbeselect  -stop
            if [ -e $MV_BEC ]
            then
                $MV_BEC stop $dbhost
            else
                msg_client.py --msg "Stopping MythBackend"
                sudo sv stop mythbackend
            fi
        else
            #linhes style
            sudo sv stop mythbackend
        fi
        ;;

    start)
        if [ x$STARTUP_STYLE = xenhanced ]
        then
            #/usr/MythVantage/bin/mythbeselect  -stop
            if [ -e $MV_BEC ]
            then
                $MV_BEC start $dbhost
            else
                msg_client.py --msg "Starting MythBackend"
                sudo sv start mythbackend
            fi
        else
            #linhes style
            sudo sv start mythbackend
        fi
        ;;

    restart)
        if [ x$STARTUP_STYLE = xenhanced ]
        then
            #/usr/MythVantage/bin/mythbeselect  -stop
            if [ -e $MV_BEC ]
            then
                $MV_BEC restart $dbhost
            else
                msg_client.py --msg "Restarting MythBackend"
                sudo sv restart mythbackend
            fi
        else
            #linhes style
            sudo sv restart mythbackend
        fi
        ;;

        *)  echo "options are:  stop  start restart"
        ;;

esac