The GuardDog acts as a dog that patrols your house searching for possible intruders. It moves around, avoid obstacles. If it hears a sound, it stops to search for an intruder. If motion is detected, it begins to bark and notify via bluetooth the owner.
#!/bin/bash
sendEmail () {
SUBJECT='GuardDog: Intruder Detected!'
BODY='GuardDog has detected an intruder in your house! Check to make sure nothing is happening to your home and everyone and all of your belongings are safe! Woof Woof.'
TO='EMAIL_TO_RECIEVE_ALERT'
FROM='GuardDog'
if [ -n "$(cat)" ]
then
echo "$BODY" | mail -r "$FROM" -a "From:$FROM" -s "$SUBJECT" "$TO"
fi
}
echo "Listening."
trap "echo Exiting.; exit;" SIGINT SIGTERM
cat /dev/tty.HC-06-DevB | sendEmail | awk '{system("echo Sending Email, `date`.")}'
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.