LR_CHECK_SERVICE.IN(1)

NAME
lr_check_service - canonicalize and check existence of Lire service

SYNOPSIS
lr_check_service service

lr_check_service -l

DESCRIPTION
lr_check_service checks if service service is supported in Lire, either as-is or after canonicalization. Canonicalization is offered for backwards compatibility. It returns either a newline and a user friendly error message or the (possibly canonicalized) service name.

lr_check_service calls Lire::Config::check_service to perform the real work: this script is supplied only to enable access to this perl routine from shell scripts.

lr_check_service exits 0, even if service is not supported.

When called with the -l (for `list') option, lr_check_service lists all supported services' canonical names.

Refer to the Lire::Config(3pm) manpage for details.

Like all Lire scripts, you might want to call this script via lr_run(1), to deal sanely with this scripts' debug- and logging output.

EXAMPLE
Call this script in shell scripts as

 LR_SERVICE="$1"
 LR_SERVICE=`lr_check_service "$LR_SERVICE"`
 if test -z "$LR_SERVICE"
 then
    echo >&2 "$tag err lr_check_service failed"
    exit 1
 fi
 # now go using $LR_SERVICE
.

`lr_check_service bind8' returns `bind8_query'. `lr_check_service qmail' returns `qmail'. `lr_check_service foobar' returns `' and an errormessage listing all supported service names.

SEE ALSO
Lire::Config(3pm)

VERSION
$Id: lr_check_service.in,v 1.6 2002/08/18 16:49:40 flacoste Exp $

COPYRIGHT
Copyright (C) 2002 Stichting LogReport Foundation LogReport@LogReport.org

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html or write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.

AUTHOR
Joost van Baal <joostvb@logreport.org>