-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
26 lines (23 loc) · 859 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
#!/bin/bash
[[ "$@" =~ 'usb' || "$@" =~ 'usb0' ]] && usb0="--device=/dev/ttyUSB0"
[[ "$@" =~ 'usb1' ]] && usb1="--device=/dev/ttyUSB1"
[[ "$@" =~ "zigate" || "$@" =~ "gpio" || "$@" =~ "deconz" ]] && privileged="--privileged"
run="sudo docker run \
-d \
$privileged \
--network=host \
$usb0 \
$usb1 \
--device=/dev/ttyAMA0 \
--device=/dev/vchiq \
-e LD_LIBRARY_PATH=/opt/vc/lib \
-v /opt/vc:/opt/vc:ro \
-v /etc/localtime:/etc/localtime \
-v $HOME/docker-data/domoticz/domoticz.db:/root/domoticz/domoticz.db:rw \
-v $HOME/docker-data/domoticz/domoticz.pem:/root/domoticz/domoticz.pem:rw \
-v $HOME/docker-data/domoticz/domoticz.log:/var/log/domoticz.log:rw \
--name domoticz \
--restart=always \
tloxipeuhca/rpi-domoticz-docker"
echo $run
eval $run