Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "Content-type: text/html"
- echo ""
- echo 'Bell Rang!!!'
- echo ""
- echo ""
- img="$(date +%s)";
- let h="$(date +%H)";
- echo "====================" >> /tmp/doorbell.log
- date >> /tmp/doorbell.log
- echo "Hour: $h" >> /tmp/doorbell.log
- #if it's between 8AM and 8PM ring bell
- if [[ "$h" -ge 8 ]] && [[ "$h" -lt 22 ]]
- then
- echo "Rang..." >> /tmp/doorbell.log
- wget -q "http://<your server>/doorbell.php?title=Door Bell Rang" -O /dev/null &
- mplayer bell.mp3 > /dev/null &
- wget -q "http://<wife's computer>/cgi-bin/doorbell.cgi" -O /dev/null &
- #switch camera to front door view
- wget --user=<user> --password=<password> "http://<camera>/SetChannel.cgi?Channel=2" -O /dev/null
- fi
- #take 3 photos and up load them to server
- for i in `seq 1 4`
- do
- wget --user=<user> --password=<password> "http://<camera>/Jpeg/CamImg.jpg" -O "../imgs/${img}_${i}.jpg" &&
- curl -X POST -F "file=@../imgs/${img}_${i}.jpg" "https://<your server>/upload.php" -o /dev/null
- sleep 1
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement