X-Git-Url: https://git.rvb.name/openhab-process.git/blobdiff_plain/e45fbbdab6046a52069555acca03c2cdad6896a6..029236a4f794e6cd047045491cca559bcff36ff9:/mqtt-bt/bt-proximity~?ds=sidebyside diff --git a/mqtt-bt/bt-proximity~ b/mqtt-bt/bt-proximity~ new file mode 100755 index 0000000..bfbbfdb --- /dev/null +++ b/mqtt-bt/bt-proximity~ @@ -0,0 +1,21 @@ +#!/bin/sh + +. /etc/bt-proximity.conf + +host=`hostname` + +hciconfig hci0 up + +cat $1 | while read mac user +do + + if [ "$mac" != "" ] + then + l2ping -c 2 -t 10 $mac + if [ "$?" = "0" ] + then + mosquitto_pub -h $mqtt_host -p $mqtt_port -u $mqtt_user -P $mqtt_passwd -t $mqtt_topic/$user -m $host + fi + fi + +done