System information

Shell Script Examples
Axis Communications AB provides NO support for application development of any kind. The information
here is provided "as is", and there is no guarantee that any of the examples shown will work in your
particular application.
Revision 1.02 October 2002 79
6.2.3.1 Task.list
This is the task.list. used to run the script above.
# If a positive transition is detected on the IO port 0, execute the
# script for the first camera and the buffer named SNAP1
date(w(0,1,2,3,4,5,6)) pattern ((IO0:/)) immune once %
/etc/scripts/seq_ftp_net : CAM1 SNAP1;
6.2.4 Example 4 – Upload Images via E-mail
This script will send 4 (2 pre-alarm and 2 post-alarm) images as attachments in an e-mail.
The following variables defined in the config file of the camera are used:
# --- General camera parameters ---
# The index of the name(s) of the buffer(s) started
sources="1"
# The format of the images specified to be taken according to HTTP-API
image_format="fullsize"
# Number of pre alarm images to be taken
pre=2
# Number of post alarm images to be taken
post=2
# Delay between pre images in milliseconds
predelay=1000
# Delay between post-images in milliseconds
postdelay=1000
# --- SMTP parameters ---
# The server to use as mail server
smtp_server="mail.somewhere.com"
# The subject to use in the mail
subject="'Alarm'"
# The specified sender
from="someone@somewhere.com"
# The specified receiver of reply
reply="someone@somewhere.com"
# The specified receiver of a copy of this mail
cc="someone@somewhere.com "
# The body to insert into the mail. Note that this must be specified and
# point to a valid file
body="/tmp/var/log/messages"
# The specified recipient
to="someone@somewhere.com"