-
Notifications
You must be signed in to change notification settings - Fork 52
/
run.sh
executable file
·35 lines (32 loc) · 929 Bytes
/
run.sh
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
#!/usr/bin/env bash
#set -e
if [ ! -f run.sh ]; then
echo 'install must be run within its container folder' 1>&2
exit 1
fi
ps -ef|grep dreamgo |grep -v grep
if [ $? -ne 0 ];then
source ./install.sh
if [ ! -f bin/dreamgo ];then
echo .........the command install fail.........
exit 1
else
echo .........the program is starting.......
nohup ./bin/dreamgo >/dev/null 2>&1 &
echo .........started success.........
echo finished
fi
else
echo .........run kill exist process.........
ps -ef|grep dreamgo |grep -v grep |awk '{print $2}' |xargs kill -9 >/dev/null 2>&1
source ./install.sh
if [ ! -f bin/dreamgo ];then
echo .........the command install fail.........
exit 1
else
echo .........the program is starting.......
nohup ./bin/dreamgo >/dev/null 2>&1 &
echo .........started success.........
echo start finished
fi
fi