Koha/misc/bin/sip_run.sh
Colin Campbell 8e485c6112 Bug 8271 teach SIPServer.pm to set its own lib path
SIPServer.pm requires that C4/SIP is added to its lib
path This has been done by passing this directory
to it via -I. By using FindBin it can set the path
for itself correctly. This will also work if the C4/SIP
directory tree is moved to a non-standard location
Removed the now redundant -I. from sip_run.sh

Added a variable to sip_run.sh for the koha tree to
highlight a problem with the script if you have multiple
directories in the PERL5LIB environment variable

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-06 18:28:11 +02:00

45 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
#
# A sample script for starting SIP.
# You probably want to specify new log destinations.
#
# Takes 3 optional arguments:
# ~ SIPconfig.xml file to use
# ~ file for STDOUT, default ~/sip.out
# ~ file for STDERR, default ~/sip.err
#
# The STDOUT and STDERR files are only for the SIPServer process itself.
# Actual SIP communication and transaction logs are handled by Syslog.
#
# Examples:
# sip_run.sh /path/to/SIPconfig.xml
# sip_run.sh ~/my_sip/SIPconfig.xml sip_out.log sip_err.log
for x in HOME PERL5LIB KOHA_CONF ; do
echo $x=${!x}
if [ -z ${!x} ] ; then
echo ERROR: $x not defined;
exit 1;
fi;
done;
unset x;
# you should hard code this if you have multiple directories
# in your PERL5LIB
PERL_MODULE_DIR=$PERL5LIB
cd $PERL_MODULE_DIR/C4/SIP;
echo;
sipconfig=${1};
outfile=${2:-$HOME/sip.out};
errfile=${3:-$HOME/sip.err};
if [ $sipconfig ]; then
echo "Running with config file located in $sipconfig" ;
echo "Calling (backgrounded):";
echo "perl ./SIPServer.pm $sipconfig >>$outfile 2>>$errfile";
perl ./SIPServer.pm $sipconfig >>$outfile 2>>$errfile &
else
echo "Please specify a config file and try again."
fi