]> git.evergreen-ils.org Git - working/SIPServer.git/blob - sip_run.sh
Fix checksum generation so that it actually works with clients.
[working/SIPServer.git] / sip_run.sh
1 #!/bin/bash
2
3 # A sample script for starting SIP.  
4 # You probably want to specify new log destinations.
5 #
6 # Takes 3 optional arguments:
7 # ~ SIPconfig.xml file to use
8 # ~ file for STDOUT, default ~/sip.out
9 # ~ file for STDERR, default ~/sip.err
10 #
11 # The STDOUT and STDERR files are only for the SIPServer process itself.
12 # Actual SIP communication and transaction logs are handled by Syslog.
13 #
14 # Examples:
15 #   sip_run.sh /path/to/SIPconfig.xml
16 #   sip_run.sh ~/my_sip/SIPconfig.xml sip_out.log sip_err.log
17
18
19 for x in HOME PERL5LIB; do
20         echo $x=${!x}
21         if [ -z ${!x} ] ; then 
22                 echo ERROR: $x not defined;
23                 exit 1;
24         fi;
25 done;
26 unset x;
27 # cd $PERL5LIB/C4/SIP;
28 echo;
29 echo Running from `pwd`;
30
31 sipserver='./SIPServer.pm';
32 sipconfig=${1:-`pwd`/SIPconfig.xml};
33 outfile=${2:-$HOME/sip.out};
34 errfile=${3:-$HOME/sip.err};
35
36 if [ ! -r $sipconfig ] ; then
37     echo "ERROR: Required SIP Configuration file not found at '$sipconfig'" >&2;
38     exit 1;
39 fi
40 if [ ! -r $sipserver ] ; then
41     echo "ERROR: Target SIPServer not found at '$sipserver'" >&2;
42     exit 1;
43 fi
44 echo "Calling (backgrounded):";
45 echo "perl -I./ $sipserver $sipconfig >>$outfile 2>>$errfile";
46 perl -I./ $sipserver $sipconfig >>$outfile 2>>$errfile &