summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-08-26 21:54:04 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-08-26 21:54:04 (GMT)
commit3a56a447fd5912114eab0e87cf550d7af8f2524a (patch)
tree400467b8149625e75fbf38a6a10ac31583ac810d
parent4efd149b0369c26b34651bf970db09cc20cf25bd (diff)
downloadlinhes_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
-rwxr-xr-xabs/core/LinHES-system/PKGBUILD3
-rw-r--r--abs/core/LinHES-system/lh_backend_control.sh75
2 files changed, 77 insertions, 1 deletions
diff --git a/abs/core/LinHES-system/PKGBUILD b/abs/core/LinHES-system/PKGBUILD
index e2bb3ce..3da9578 100755
--- a/abs/core/LinHES-system/PKGBUILD
+++ b/abs/core/LinHES-system/PKGBUILD
@@ -21,7 +21,7 @@ binfiles="LinHES-start optimize_mythdb.py
lh_system_all_host_update
add_storage.py
diskspace.sh
- cacheclean lh_message.sh switch_web.sh
+ cacheclean lh_message.sh lh_backend_control.sh switch_web.sh
create_media_dirs.sh
msg_client.py msg_daemon.py gen_is_xml.py gen_lib_xml.py"
@@ -81,6 +81,7 @@ md5sums=('4921a6e21c71b263b8d23c51c24b939c'
'b8f0414427c5d9afdc32ceb3ae56f82a'
'6519d209e151cdc39ae7e1091d189c3e'
'd1cdf28fcb1c88f0e504905771dd6040'
+ '88c669b8eeb988106bd26c9cf8277df2'
'4a3cd8f9b33b2b86fdba47a8f1fa2859'
'359a4bf507b8104b6af9e53b5c784b94'
'a182af47a7d373b2a63a27e1bb7485b2'
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
+
+