#!/bin/sh # Motion sample script to send an email at start of an event. # Replaces the former 'mail' option. # Just define this script as 'on_event_start'-script in motion.conf like that: # on_event_start send_mail "%Y-%m-%d %T" #change to suit your needs: #location of 'mail' binary MAIL="mail" #Destination e-mail address TO="root@localhost" #Subject of the e-mail SUBJECT="Motion detected" #Don't change anything below this line echo "This is an automated message generated by motion.\n\nMotion detected: $1\n\n" | $MAIL -s "$SUBJECT" $TO