3 # Copyright (C) 2010 Equinox Software, Inc.
4 # Author: Joe Atzberger
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # A sample script for starting SIP.
20 # You probably want to specify new log destinations.
22 # Takes 3 optional arguments:
23 # ~ SIPconfig.xml file to use
24 # ~ file for STDOUT, default ~/sip.out
25 # ~ file for STDERR, default ~/sip.err
27 # The STDOUT and STDERR files are only for the SIPServer process itself.
28 # Actual SIP communication and transaction logs are handled by Syslog.
31 # sip_run.sh /path/to/SIPconfig.xml
32 # sip_run.sh ~/my_sip/SIPconfig.xml sip_out.log sip_err.log
35 for x in HOME PERL5LIB; do
37 if [ -z ${!x} ] ; then
38 echo ERROR: $x not defined;
43 # cd $PERL5LIB/C4/SIP;
45 echo Running from `pwd`;
47 sipserver='./SIPServer.pm';
48 sipconfig=${1:-`pwd`/SIPconfig.xml};
49 outfile=${2:-$HOME/sip.out};
50 errfile=${3:-$HOME/sip.err};
52 if [ ! -r $sipconfig ] ; then
53 echo "ERROR: Required SIP Configuration file not found at '$sipconfig'" >&2;
56 if [ ! -r $sipserver ] ; then
57 echo "ERROR: Target SIPServer not found at '$sipserver'" >&2;
60 echo "Calling (backgrounded):";
61 echo "perl -I./ $sipserver $sipconfig >>$outfile 2>>$errfile";
62 perl -I./ $sipserver $sipconfig >>$outfile 2>>$errfile &