Technical information

INSTALLATION AND ADMINISTRATION GUIDE
118
#---------------------------------------------------
#
# Update log file
puts $f "The fax scheduler was stopped"
# Email notification to specified mail address
catch { [ exec "$VSIFAX/lbin/vmime -t \
-o$VSIFAX/spool/temp/stopwarn \
$VSIFAX/spool/logs/sys-stop.log" ] }
catch { [ exec "$VSIFAX/lbin/vmail" "$EMAIL" \
"$VSIFAX/spool/temp/stopwarn" ] }
#
exit 0
Below is a sample stop shell script (sys-stop.sh) that sends an email message to anon@example.com every time
the fax server is stopped:
#!/bin/sh
#
# Filename: sys-stop.sh
# Description: script that is run at shutdown of scheduler
#-------------------------------------------------------
# Get arguments
PID="$1"
LOG="$VSIFAX/spool/logs/sys-stop.log"
EMAIL="anon@example.com"
SUBJECT="Warning from Esker"
# ------------------------------------------------------
# Update log file
echo "The fax scheduler was stopped at: `date`" > $LOG
# Email notification to specified mail address
$VSIFAX/lbin/vmime -t -s "$SUBJECT" \
-o $VSIFAX/spool/temp/stopwarn \
$VSIFAX/spool/logs/sys-stop.log
$VSIFAX/lbin/vmail $EMAIL $VSIFAX/spool/temp/stopwarn
rm $VSIFAX/spool/temp/stopwarn
# ------------------------------------------------------
#
exit 0
Examples for Windows platforms
The following sample scripts run on Windows platforms only (not on Unix and Linux platforms).
Below is a sample start Tcl script (sys-start.tcl) that is called when the VSI-FAX server starts. It logs the start
time in %VSI-FAX%/spool/logs/sysstart and sends an email to an administrator.
#--------------------------------------------------------
# sys-start.tcl
# VSI-FAX scheduler start notification for Windows
#--------------------------------------------------------
#--------------------------------------------------------
# Get all arguments and setup environment
#--------------------------------------------------------
global argv env
set PID [lindex $argv 0]
set VSIFAX $env(VSIFAX)
set TIMESTAMP [ clock format [ clock seconds ] -format {%Y/%m/%d %H:%M:%S} ]
set ERROR "VSI-FAX scheduler \[$PID\] started"
set EMAIL email@address.com
#-------------------------------------------------------
# Update log file
#-------------------------------------------------------
set f [ open $VSIFAX\\spool\\logs\\sysstart a+ ]