Skip to content

Instantly share code, notes, and snippets.

@drakmail
Created February 18, 2013 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drakmail/4977094 to your computer and use it in GitHub Desktop.
Save drakmail/4977094 to your computer and use it in GitHub Desktop.
#!/bin/sh
HERE=0
while [ 1 -eq 1 ]; do
hcitool info 54:9B:12:9B:9E:0D > /dev/null
MAG=$?
hcitool info F4:9F:54:4F:6F:23 > /dev/null
V1RUS=$?
if [ $V1RUS -eq 0 -o $MAG -eq 0 ] ; then
echo "HE IS HERE"
if [ $V1RUS -eq 0 ] ; then
echo "V1RUS HERE"
fi
if [ $MAG -eq 0 ] ; then
echo "MAG HERE"
fi
if [ $HERE -eq 0 ]; then
echo "Stopping motion..."
killall motion
fi
HERE=1
else
echo "HE IS NOT HERE"
if [ $V1RUS -eq 1 ] ; then
echo "V1RUS NOT HERE"
fi
if [ $MAG -eq 1 ] ; then
echo "MAG NOT HERE"
fi
if [ $HERE -eq 1 ]; then
echo "Starting motion..."
motion
fi
HERE=0
fi
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment