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 82
# The path to append to sequential uploads. This path must exist on the
# server prior to upload
seq_destination="upload/sequential"
# --- 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"
#!/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
# Stop the alarm buffers
bufferd -stop -buffername $2
# Test if cc is present, if yes add -c $cc to the command, otherwise
# leave blank
if [ x$cc != "x" ]; then
copy="-c $cc"
fi
# Send the mail
smtpclient -s $subject -S $smtp_server -f $from -r $reply $copy -b $body $to
if [ $? -eq 1 ]; then
logger -t $0[$$] SMTP failed!
fi
# Path of the status file
status_file="/tmp/$2/status"
# Wait until bufferd is ready with the images, i.e. the status file is
# present and delete it after
expr $predelay + $postdelay > /tmp/F
tmp=`cat /tmp/F`; expr $tmp / 1000 > /tmp/F
tmp=`cat /tmp/F`; rm /tmp/F
The script itself: