diff options
author | James Meyer <james.meyer@operamail.com> | 2012-08-26 21:54:04 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2012-08-26 21:54:04 (GMT) |
commit | 3a56a447fd5912114eab0e87cf550d7af8f2524a (patch) | |
tree | 400467b8149625e75fbf38a6a10ac31583ac810d /abs/core/LinHES-system/lh_backend_control.sh | |
parent | 4efd149b0369c26b34651bf970db09cc20cf25bd (diff) | |
download | linhes_pkgbuild-3a56a447fd5912114eab0e87cf550d7af8f2524a.zip linhes_pkgbuild-3a56a447fd5912114eab0e87cf550d7af8f2524a.tar.gz linhes_pkgbuild-3a56a447fd5912114eab0e87cf550d7af8f2524a.tar.bz2 |
LinHES-system: add lh_backend_control.sh Wrapper script for the starting/restarting/stopping mythbackend
Diffstat (limited to 'abs/core/LinHES-system/lh_backend_control.sh')
-rw-r--r-- | abs/core/LinHES-system/lh_backend_control.sh | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/abs/core/LinHES-system/lh_backend_control.sh b/abs/core/LinHES-system/lh_backend_control.sh new file mode 100644 index 0000000..b15ca35 --- /dev/null +++ b/abs/core/LinHES-system/lh_backend_control.sh @@ -0,0 +1,75 @@ +#!/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 "Stopping backend" + 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 "Starting backend" + 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 "Restarting backend" + sudo sv restart mythbackend + fi + else + #linhes style + sudo sv restart mythbackend + fi + ;; + + *) echo "options are: stop start restart" + ;; + +esac + + |