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 72
6.2 Script examples
The script examples that follow are located in the ROM file system of the Axis camera/video
server. The scripts are, in their default implementations, “configured” by the Application
Wizard, which is available from the product’s configuration pages. The scripts are shown here as
they actually are, and the configuration options described won’t actually change the scripts
themselves.
It is, of course, also possible to write your own custom scripts from scratch, or to modify the
existing ones as required. The new or modified script must then be placed in the read/write area
of the flash memory: e.g. /etc/script.
6.2.1 Example 1 – Upload via FTP
This script will upload 2 pre-alarm and 2 post-alarm images via FTP. It is fairly general and may
be used in many different configurations.
The following variables defined in the camera/video server’s config file 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 password 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"