summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/lh_backend_control.sh
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/LinHES-system/lh_backend_control.sh')
-rw-r--r--abs/core/LinHES-system/lh_backend_control.sh75
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
+
+