cpp-d1064d
[projects.git] / eibd / start-eibd
1 #!/bin/bash
2 set -e
3
4 if [ -e /dev/ttyAMA0 ]
5 then
6         EIB_URL="tpuarts:/dev/ttyAMA0"
7         # ttyAMA0 interferes with others. Check if everything is deactivated
8         if [ -f /etc/inittab ]
9         then
10                 if grep ttyAMA0 /etc/inittab
11                 then
12                         echo "ttyAMA0 not deactivated. Run dpkg eibd --reconfigure."
13                         exit 10
14                 fi
15         fi
16 elif [ -e /dev/ttyACM0 ]
17 then
18         EIB_URL="tpuarts:/dev/ttyACM0"
19 else
20         EIB_URL="ipt:127.0.0.1"
21 fi
22
23 echo "running under $IND_ADDR"
24 echo "connect with $EIB_URL"
25 /usr/bin/eibd -i -DTS -e $IND_ADDR $ADD_PARAM $EIB_URL &
26