checks that the config file passed in parameter exist, otherwise, uses the default one (/etc/koha.conf)

useful in upgradedb2marc.pl script.
* if this script is called during installation, uses /etc/koha.conf.tmp
* if it's called manually (after installation), uses /etc/koha.conf, as the tmp file is no more here :-)
This commit is contained in:
tipaul 2002-12-20 13:54:31 +00:00
parent 88034fbccb
commit 40d6ddb383
1 changed files with 2 additions and 1 deletions

View File

@ -169,6 +169,8 @@ sub new
my $conf_fname = shift; # Config file to load
my $self = {};
# check that the specified config file exists
undef $conf_fname unless (-e $conf_fname);
# Figure out a good config file to load if none was specified.
if (!defined($conf_fname))
{
@ -177,7 +179,6 @@ sub new
$conf_fname = $ENV{"KOHA_CONF"} ||
CONFIG_FNAME;
}
$self->{"config_file"} = $conf_fname;
# Load the desired config file.