From 8d05e4e790d982e9d6ec8cbb2496533d564f553b Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Thu, 29 Aug 2013 10:09:48 +1200 Subject: [PATCH] Making a start_server.pl file to run ./bin/start_server.pl -c /path/to/config_dir Signed-off-by: Jason Stephenson --- bin/start_server.pl | 59 +++++++++++++++++++++++++++++++++++++++++++++ test_server.pl | 29 ---------------------- 2 files changed, 59 insertions(+), 29 deletions(-) create mode 100755 bin/start_server.pl delete mode 100755 test_server.pl diff --git a/bin/start_server.pl b/bin/start_server.pl new file mode 100755 index 0000000..814130d --- /dev/null +++ b/bin/start_server.pl @@ -0,0 +1,59 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: test_server.pl +# +# USAGE: ./test_server.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: Chris Cormack (rangi), chrisc@catalyst.net.nz +# ORGANIZATION: Koha Development Team +# VERSION: 1.0 +# CREATED: 28/08/13 14:12:51 +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; + +use lib "lib"; + +use NCIPServer; +use Getopt::Long; + +my $help; +my $config_dir; + +GetOptions( + 'h|help' => \$help, + 'c|config:s' => \$config_dir, +); +my $usage = << 'ENDUSAGE'; + +This script will start an NCIP server, using the configuration set in the config dir you pass + +This script has the following parameters : + -h --help: this message + -c --config: path to the configuration directory + +ENDUSAGE + +if ($help) { + print $usage; + exit; +} + +if ( !$config_dir ) { + print "You must specify a configuration directory\n"; + print $usage; + exit; +} + +my $server = NCIPServer->new( { config_dir => $config_dir } ); + +$server->run(); diff --git a/test_server.pl b/test_server.pl deleted file mode 100755 index 1d30a6e..0000000 --- a/test_server.pl +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/perl -#=============================================================================== -# -# FILE: test_server.pl -# -# USAGE: ./test_server.pl -# -# DESCRIPTION: -# -# OPTIONS: --- -# REQUIREMENTS: --- -# BUGS: --- -# NOTES: --- -# AUTHOR: Chris Cormack (rangi), chrisc@catalyst.net.nz -# ORGANIZATION: Koha Development Team -# VERSION: 1.0 -# CREATED: 28/08/13 14:12:51 -# REVISION: --- -#=============================================================================== - -use strict; -use warnings; - -use lib "lib"; - -use NCIPServer; - -my $server = NCIPServer->new( { config_dir => 't/config_sample' } ); -$server->run(); -- 2.43.2