-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiotdsm-start.sh
executable file
·65 lines (56 loc) · 1.41 KB
/
iotdsm-start.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
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
#!/bin/bash
db_type="$1"
start_pgsql(){
SERVICE=postgres
if P=$(pgrep $SERVICE)
then
echo "$SERVICE is already running"
else
echo "starting postgresql"
/etc/init.d/postgresql start
fi
}
start_mysql(){
SERVICE=mysql
if P=$(pgrep $SERVICE)
then
echo "$SERVICE is already running"
else
echo "starting mysql"
/etc/init.d/mysql start
fi
}
start_mongo(){
SERVICE=mongod
if P=$(pgrep $SERVICE)
then
echo "$SERVICE is already running"
else
echo "starting mongod"
/usr/bin/mongod --config /etc/mongod.conf &
fi
}
start_iotdsm(){
if [ ! -f "build/libs/iotdsm-services-all-1.0.0.jar" ]; then
bash -c "gradle build fatJar -x test --parallel"
fi
properties_file=""
if [ "$db_type" = "pgsql" ]; then
echo "init pgsql database..."
start_pgsql
properties_file="pgsql-hb.properties"
elif [ "$db_type" = "mysql" ]; then
echo "init mysql database..."
start_mysql
properties_file="mysql-hb.properties"
elif [ "$db_type" = "mongo" ]; then
echo "init mongo database..."
start_mongo
properties_file="mongo.properties"
fi
echo "init iotdsm application..."
bash -c "java -jar build/libs/iotdsm-services-all-1.0.0.jar -c=$properties_file"
}
#edu.usp.icmc.lasdpc.ImportData
sh clean-log.sh
start_iotdsm