-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·31 lines (30 loc) · 816 Bytes
/
start.sh
File metadata and controls
executable file
·31 lines (30 loc) · 816 Bytes
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
#!/bin/bash
device0="/dev/ttyACM0"
device1="/dev/ttyACM1"
IMAGE="atong01/rpi-trst-dev"
if [ -e "$device0" ]
then
if [ -e "$device1" ]
then
echo "Two arduinos connected"
docker run -it -p 8888:8888 \
-v $PWD/data:/root/data \
-v $PWD/trst:/root/trst \
--device="/dev/ttyACM1:/dev/ttyACM1" \
--device="/dev/ttyACM0:/dev/ttyACM0" \
$IMAGE
else
echo "One arduino connected"
docker run -it -p 8888:8888 \
-v $PWD/data:/root/data \
-v $PWD/trst:/root/trst \
--device="/dev/ttyACM0:/dev/ttyACM0" \
$IMAGE
fi
else
echo "No Arduinos connected"
docker run -it -p 8888:8888 \
-v $PWD/data:/root/data \
-v $PWD/trst:/root/trst \
$IMAGE
fi