aboutsummaryrefslogtreecommitdiff
path: root/system/eibd/rc.eibd.new
blob: d1514c18b3b2fd7fe365c63c8a6b1bbd098619f8 (plain)
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
#!/bin/sh
# rc.eibd -- Slackware startup script for eibd
# Start/stop/restart the eibd daemon.
# Written by V'yacheslav Stetskevych

# Run "eibd --help" to see all the various bus connection options.
# This script shows how to set up an IP Tunneling and USB connectios.
# Adapt to your needs.

eib_start() {
echo "Adding a multicast route for eibd..."
/sbin/route add 224.0.23.12 dev eth0

echo "Starting the eibd daemon..."
echo "$0: Startup error: first uncomment one of the startup options and remove this line."

## IP Tunnelling backend ================================================
## Use "eibnetsearch -" to locate your IP-capable BCU devices
#KNXIP="192.168.0.5"
#/usr/bin/eibd -DTS --daemon=/var/log/eibd.log --listen-tcp ipt:$KNXIP

## USB backend ==========================================================
#KNXUSB="$(findknxusb | awk '{print $2}' | grep -v addr)"
#/usr/bin/eibd -DTS --daemon=/var/log/eibd.log --listen-tcp usb:$KNXUSB

}

eib_stop() {
  echo "Deleting the eibd multicast route..."
  /sbin/route del 224.0.23.12
  echo "Stopping the eibd daemon..."
  killall eibd >/dev/null 2>&1
}

case $1 in
  start)  
    eib_start
   ;;
  stop)
    eib_stop
   ;;
  restart)
    eib_stop
    sleep 2
    eib_start
   ;;
  *) 
    echo "Usage: $0 {start|stop|restart}"
    exit 1
   ;;
esac