From fde9537cbeb38ea78f5ad5656723367ca65b609a Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 23 Nov 2010 21:52:12 +0000 Subject: use upload.conf from /etc/iurt if not in home (could be factorized together and with iurt config file code) --- emi | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'emi') diff --git a/emi b/emi index 0b77a05..bf9d4ab 100755 --- a/emi +++ b/emi @@ -46,6 +46,17 @@ $run{LOG} = sub { print $LOG @_ }; my $HOME = $ENV{HOME}; my $configfile = "$HOME/.upload.conf"; +my $sysconfigfile = "/etc/iurt/upload.conf"; + +my $config = {}; +foreach my $f ($configfile, $sysconfigfile) { + plog('DEBUG', "load config: $f"); + if (-f $f) { + $config = eval(cat_($f)) + or die "FATAL $program_name: syntax error in $f"; + last; + } +} my %config_usage = ( admin => { @@ -94,14 +105,6 @@ my %config_usage = ( }, ); -my $config; -if (-f $configfile) { - $config = eval(cat_($configfile)) - or die "FATAL $program_name: syntax error in $configfile"; -} else { - $config = {}; -} - config_usage(\%config_usage, $config) if $run{config_usage}; config_init(\%config_usage, $config, \%run); -- cgit v1.2.1