View Single Post
Posts: 9 | Thanked: 0 times | Joined on Feb 2010
#37
Example to detect: 00:BD:3A and 00:BD:3B ... (expand with \| as address separator)

Code:
#!/bin/bash 
a=`hcitool scan --class |\ 
awk '/BD Address/ {print substr($3,0,8)}' |\ 
grep '00:BD:3A\|00:BD:3B'`; 
echo $a; 
if [ "$a" ] 
then 
dbus-send --type=method_call \ 
--dest=org.freedesktop.Notifications \ 
/org/freedesktop/Notifications \ 
org.freedesktop.Notifications.SystemNoteDialog \ 
string:'Pizza! N900 here!' uint32:0 string:'OK' 
fi;
Save code to: ~/n900finder.sh
Make executable: chmod 755 ~/n900finder.sh
and add a shortcut on your desktop or execute from xterminal (~/n900finder.sh).

It shows an alert (Pizza) if found, otherwise it does nothing.

You can schedule using cron or add a loop and a sleep to have it running in the background.