-
Notifications
You must be signed in to change notification settings - Fork 0
/
rclida~
executable file
·75 lines (59 loc) · 1.04 KB
/
rclida~
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
74
75
#!/bin/sh
HERE=$(pwd)
modeoptions="normal"
proc=""
function startmain {
if [ -n "$LD_LIBRARY_PATH" ]
then
LD_LIBRARY_PATH="$HERE/lib:$LD_LIBRARY_PATH"
else
LD_LIBRARY_PATH="$HERE/lib"
fi
export LD_LIBRARY_PATH
./lida-main $modeoptions
}
function stopservice {
$proc="$(ps -e | gawk '/lida-main/{ print $1 }')"
if [ -z $proc ]
then
echo "lida did not even start"
exit 1
fi
kill $proc
echo "Waiting for stop..."
sleep 3
if [ -z $(ps -e | grep lida-main) ]
then
echo "lida stopped"
else
echo "Cannot stop now. Try again later"
exit 1
fi
}
if (($# < 1))
then
echo "Usage: rclida start/stop"
exit 1
fi
if [ $1 = "start" ]
then
startmain
elif [ $1 = "start-thread" ]
then
$modeoptions="thread"
startmain
elif [ $1 = "start-mini" ]
then
$modeoptions="mini"
startmain
elif [ $1 = "stop" ]
then
stopservice
elif [ $1 = "restart" ]
then
stopservice
startmain
else
echo "Invaild command"
exit 1
fi