Skip to content

Commit 1b6ea53

Browse files
authored
Merge pull request #62 from SensorsIot/deconz-fix
Fixed bug where yaml merging was overwriting deconz services
2 parents 78d90b6 + 01eb79a commit 1b6ea53

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

.templates/deconz/build.sh

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
#deCONZ device configuration
44

5+
DOCKER_COMPOSE_PATH=./.tmp/docker-compose.tmp.yml
6+
7+
if [[ ! -f $DOCKER_COMPOSE_PATH ]]; then
8+
echo "[deCONZ] Warning: $DOCKER_COMPOSE_PATH does not exist."
9+
fi
10+
511
device_selection=$(whiptail --radiolist --title "Select deCONZ gateway" --notags \
612
"Use the [SPACEBAR] to select your deCONZ gateway from the list below AND MAKE SURE IT IS PLUGGED IN (if not, press [ESC])." 20 78 12 \
713
"ConBeeII" "ConBee II " "ON" \
@@ -12,15 +18,27 @@ device_selection=$(whiptail --radiolist --title "Select deCONZ gateway" --notags
1218
case $device_selection in
1319

1420
"ConBeeII")
15-
cat .templates/deconz/service_conbee_II.yml >>docker-compose.yml
16-
echo "...copied ConBee II config from template"
21+
if [[ ! -f ./.templates/deconz/service_conbee_II.yml ]]; then
22+
echo "Error: ./.templates/deconz/service_conbee_II.yml does not exist."
23+
else
24+
cat ./.templates/deconz/service_conbee_II.yml >> $DOCKER_COMPOSE_PATH
25+
echo "...copied ConBee II config from template"
26+
fi
1727
;;
1828
"ConBee")
19-
cat .templates/deconz/service_conbee.yml >>docker-compose.yml
20-
echo "...copied ConBee config from template"
29+
if [[ ! -f ./.templates/deconz/service_conbee.yml ]]; then
30+
echo "Error: ./.templates/deconz/service_conbee.yml does not exist."
31+
else
32+
cat ./.templates/deconz/service_conbee.yml >> $DOCKER_COMPOSE_PATH
33+
echo "...copied ConBee config from template"
34+
fi
2135
;;
2236
"RaspBee")
23-
cat .templates/deconz/service_raspbee.yml >>docker-compose.yml
24-
echo "...copied RaspBee config from template"
37+
if [[ ! -f ./.templates/deconz/service_raspbee.yml ]]; then
38+
echo "Error: ./.templates/deconz/service_raspbee.yml does not exist."
39+
else
40+
cat ./.templates/deconz/service_raspbee.yml >> $DOCKER_COMPOSE_PATH
41+
echo "...copied RaspBee config from template"
42+
fi
2543
;;
26-
esac
44+
esac

0 commit comments

Comments
 (0)