25.08.2016, 18:29
Hi
I am looking for an iPhone presence detection solution.
I found many iPhone detection bash scripts like this one
[*]
But nothing in lua.
Did anyone over here already implemented a script and wants to share this?
Thanks
Nicky
I am looking for an iPhone presence detection solution.
I found many iPhone detection bash scripts like this one
Code:
script (/opt/openhab/iphonedetect.sh)
#!/bin/bash
MAC=${2//-/:}
declare -a DEVICES
hping3 -2 -c 10 -p 5353 -i u1 $1 -q >/dev/null 2>&1
DEVICES=arp -an | awk '{print $4}'
CHECK=$MAC
if [[ ${DEVICES[*]} =~ $CHECK ]]
then
echo "ON"
else
echo "OFF"
fi
But nothing in lua.
Did anyone over here already implemented a script and wants to share this?
Thanks
Nicky