diff options
author | Hieu Hoang <fishandfrolick@gmail.com> | 2012-06-20 17:20:29 +0400 |
---|---|---|
committer | Hieu Hoang <fishandfrolick@gmail.com> | 2012-06-20 17:20:29 +0400 |
commit | 112b4c768d8a7ca9a3e718e5c5862a843da2a526 (patch) | |
tree | 0586048aad69211fa6185ad1f50607996ab82b35 /contrib | |
parent | e71f76a3e5099b95b5dff08510399f5df01a0f51 (diff) |
use FindBin() to get directory of moses exec. Get ini file from command line, not hardcoded
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/web/bin/daemon.pl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/web/bin/daemon.pl b/contrib/web/bin/daemon.pl index 8e6a08739..acb63bda7 100644 --- a/contrib/web/bin/daemon.pl +++ b/contrib/web/bin/daemon.pl @@ -1,4 +1,5 @@ #!/usr/bin/perl -w +use FindBin qw($Bin); use warnings; use strict; $|++; @@ -27,12 +28,12 @@ use IPC::Open2; #------------------------------------------------------------------------------ # constants, global vars, config -my $MOSES = '/local/herves/moses/moses-irst'; -my $MOSES_INI = '/local/herves/moses/fr-en/moses.ini.2'; +my $MOSES = "$Bin/../../../bin/moses"; -die "usage: daemon.pl <hostname> <port>" unless (@ARGV == 2); +die "usage: daemon.pl <hostname> <port> <ini>" unless (@ARGV == 3); my $LISTEN_HOST = shift; my $LISTEN_PORT = shift; +my $MOSES_INI = shift; #------------------------------------------------------------------------------ # main |