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 74
# previous started one)
date(w(01,2,3,4,5,6)) pattern ((IO0:/)) immune once %
/etc/scripts/alarm_ftp_net : CAM1 IO0;
6.2.2 Example 2 – Upload via FTP and E-mail
This script will upload 2 pre-alarm and 2 post-alarm images via FTP and also send an e-mail as
notification of the event.
The following variables defined in the config file of the camera are used in this script:
# --- 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
# --- FTP parameters ---
# The server to upload to
ftp_server="10.13.9.210"
# The port to connect to
port=21
# The user to login as
user=user
# The pass to use for the user
pass=pass
# Choose passive mode on ("yes") or off ("no") (See documentation on
# FTP protocol)
passive_mode="no"
# The path to append to all uploads. This path must exist on the
# server prior to upload
destination="upload/2400test"
# --- 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 recipient 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"