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 76
6.2.3 Example 3 – Sequential Upload via FTP
When input 0 goes high, this script will, for 10 seconds, upload images via FTP, at 2 second
intervals. The uploaded images can be named by specifying a suffix. These can be date,
incremental sequence number or limited sequence (overwrites files when maximum is reached).
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"
# The name to be given to the local file, excluding the extension
file_format="snapshot"
# Delay between image taken
delay=2000
# The time in seconds to stay in the script. A value of -1 means
# indefinitely
time=10
# The type of the suffix to use on the uploaded files. Either "date" for
# datum or "sequence" for an index limited by $countermax or
# sequenced_max" for an index up to the internal maximum integer
suffix="sequenced_max"
# Define the maximum value of the counter
counter_max=200
# --- 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"
#!/bin/mish
PATH=/bin:/sbin:/usr/bin:/usr/sbin
# Read the config file
. /etc/applications/config_$1
# Read the optional config file
if [ -e /etc/applications/pre_config_$1 ]; then
. /etc/applications/pre_config_$1
fi
The script itself: