-
Notifications
You must be signed in to change notification settings - Fork 5
/
service
executable file
·51 lines (38 loc) · 1.04 KB
/
service
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
#!/usr/bin/env bash
#
# Bash script to startup all components of home assistant, mostly through
# docker and checking if services are available using wait_for_it
declare -r DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
declare -r TIMEOUT=240
declare -r WAIT="${DIR}/wait-for-it.sh --timeout=${TIMEOUT}"
start() {
cd ${DIR}
docker-compose up -d influxdb
${WAIT} localhost:8086
docker-compose up -d postgres
${WAIT} localhost:5432
docker-compose up -d pgadmin
${WAIT} localhost:8087
docker-compose up -d grafana
${WAIT} localhost:3000
docker-compose up -d mosquitto
${WAIT} localhost:1883
docker-compose up -d esphome
${WAIT} localhost:6052
docker-compose up -d homeassistant
${WAIT} localhost:8123
docker-compose up -d appdaemon
${WAIT} localhost:5050
docker-compose up -d portainer
${WAIT} localhost:9000
}
stop() {
cd ${DIR}
docker-compose stop
}
case $1 in
start) start;;
stop) stop;;
"") start;;
*) echo "Usage: ./service start|stop"
esac