--- tools/jabberd.in.orig 2016-02-09 09:45:54 UTC +++ tools/jabberd.in @@ -1,10 +1,5 @@ -#!/bin/sh -#-*-Perl-*- +#!/usr/local/bin/perl -exec perl -w -x $0 "$@" - -#!perl - ############################################################################## # # jabberd - perl wrapper script to manage launching and controlling the various @@ -28,8 +23,7 @@ my $Bin = "@bindir@"; my $LibExec = "@libexecdir@"; my $VERSION = "@VERSION@"; my $config_dir = "@sysconfdir@"; -my $config = $config_dir."/jabberd.cfg"; -$config = "internal" unless (-e $config); +my $config = "jabberd.cfg"; my $debug = 0; my $daemon = 0; my $g_kill_signal = ""; @@ -44,13 +38,20 @@ my @programs; # Process the command line arguments #----------------------------------------------------------------------------- my %opts; -getopts("c:Dhb",\%opts); +getopts("c:d:Dhb",\%opts); &usage if exists($opts{h}); if (exists($opts{c})) { $config = $opts{c} if (defined($opts{c}) && ($opts{c} ne "")); &usage() if (!defined($opts{c}) || ($opts{c} eq "")); } +if (exists($opts{d})) +{ + $config_dir = $opts{d} if (defined($opts{d}) && ($opts{d} ne "")); + &usage() if (!defined($opts{d}) || ($opts{d} eq "")); +} +$config = $config_dir.'/'.$config if ($config !~ /^\//); +$config = "internal" unless (-e $config); $debug = 1 if exists($opts{D}); $daemon = 1 if exists($opts{b}); @@ -120,6 +121,7 @@ if ($debug) &debug("jabberd","stdout","debug on\n"); &debug("jabberd","stdout","version($VERSION)\n"); &debug("jabberd","stdout","config_dir($config_dir)\n"); + &debug("jabberd","stdout","config($config)\n"); } #-----------------------------------------------------------------------------