-
Notifications
You must be signed in to change notification settings - Fork 1
/
start.sh
executable file
·65 lines (56 loc) · 1.49 KB
/
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
# Check for help option
if [[ " $@ " =~ " -h " ]] || [[ " $@ " =~ " --help " ]];
then
printf "Usage:\n\tstart.sh [-p | --publish] [-m | --monitoring] [-h | --help]\nOptions:
\t[-p | --publish] : Expose Kafka using WIM public IP
\t[-m | --monitoring] : Start prometheus exporter module
\t[-h | --help] : Print this message and quit\n"
exit 0
fi
containers="zookeeper kafka neo4j wim-nbi wim-mngr wim-cli mongo"
# Get the options
while [[ $# -gt 0 ]]
do
key=$1
case $key in
-p | --publish)
read -p "Expose Kafka Message Bus? (Y/n) " ans
if [[ $ans != "n" ]];
then
message="WIM host public IP"
ip_list=$(hostname -I 2> /dev/null)
if (( $? == 0 ));
then
message="${message} (Available: $ip_list)"
fi
read -p "${message} >> " HOST_IP
export "DOCKER_HOST_IP=${HOST_IP}"
fi
shift
;;
-m | --monitoring)
containers=""
# Add the monitoring variable
sed -i 's/WIM_MONITORING=.*/WIM_MONITORING=True/' .env
shift
;;
*)
printf "Wrong option $key\n----------\n"
printf "Usage:\n\tstart.sh [-p | --publish] [-m | --monitoring] [-h | --help]\nOptions:
\t[-p | --publish] : Expose Kafka using WIM public IP
\t[-m | --monitoring] : Start prometheus exporter module
\t[-h | --help] : Print this message and quit\n"
exit 9999
;;
esac
done
# Check if .env file exists - If not create it
if [ ! -f .env ];
then
echo "NEO4J_AUTH=neo4j/neo4j" > .env
echo "ODL_AUTH=admin:admin" >> .env
fi
docker-compose up --build -d ${containers}
# Add the rules database
./rules_db.sh update