Step 5IoBridge Monitor
This is the bash script I used to trigger a sound as well as send a twitpic.
I used my mac os x Apache 2 server. I had to give write permissions to the access_log so I could append a bogus line as a "break".
#!/bin/bash
booCounter=$1
while true;do
status=`tail -n 1 /private/var/log/apache2/access_log | cut -f 1 -d "-"`
if [ "$status" = "00.00.000.000 " ]
then
echo "Boo" >> /private/var/log/apache2/access_log
afplay /full/path/Halloween/werewolf.mp3
msg="Boo, victim $booCounter just got really scared"
sleep 5
curl -O http://www.mywebcam.com/IMAGE.JPG
curl -F media=@/full/path/Halloween/IMAGE.JPG -F "username=username" -F "password=password" -F "message=$msg" http://twitpic.com/api/uploadAndPost
let booCounter=booCounter+1
fi
done
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|














































