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>
use strict;
use warnings;
+use FindBin qw($Bin);
+use lib "$Bin";
# use Exporter;
use Sys::Syslog qw(syslog);
use Net::Server::PreFork;
fi;
done;
unset x;
-cd $PERL5LIB/C4/SIP;
+# 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};
if [ $sipconfig ]; then
echo "Running with config file located in $sipconfig" ;
echo "Calling (backgrounded):";
- echo "perl -I./ ./SIPServer.pm $sipconfig >>$outfile 2>>$errfile";
- perl -I./ ./SIPServer.pm $sipconfig >>$outfile 2>>$errfile &
+ 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."