summaryrefslogtreecommitdiff
path: root/src/appMain/core.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/appMain/core.sh')
-rw-r--r--src/appMain/core.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/appMain/core.sh b/src/appMain/core.sh
new file mode 100644
index 0000000000..4d3fbfce1e
--- /dev/null
+++ b/src/appMain/core.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+cd $(dirname $0)
+DIR=$(pwd)
+PID_FILE=$DIR/core.pid
+
+function core_start() {
+ echo "Starting SmartDeviceLinkCore"
+ LD_LIBRARY_PATH=$DIR ${DIR}/smartDeviceLinkCore &
+ PID=$!
+ echo $PID > $PID_FILE
+}
+
+function core_stop() {
+ echo "Stopping SmartDeviceLinkCore"
+ kill $(cat $PID_FILE)
+ rm $PID_FILE
+}
+
+if [ x$1 == xstop ]; then
+ core_stop
+elif [ x$1 == xrestart ]; then
+ core_stop
+ core_start
+elif [ x$1 == xstart ]; then
+ core_start
+else
+ echo "usage: core.sh [start/restart/stop]"
+fi