diff options
author | Olivier Blin <blino@mageia.org> | 2010-11-23 21:52:12 +0000 |
---|---|---|
committer | Olivier Blin <blino@mageia.org> | 2010-11-23 21:52:12 +0000 |
commit | fde9537cbeb38ea78f5ad5656723367ca65b609a (patch) | |
tree | aa4372a52168478afb011d740854d34cc03b0267 /emi | |
parent | 72a3d5b8f557fe5cafde720e0056e9d152a03f38 (diff) | |
download | iurt-fde9537cbeb38ea78f5ad5656723367ca65b609a.tar iurt-fde9537cbeb38ea78f5ad5656723367ca65b609a.tar.gz iurt-fde9537cbeb38ea78f5ad5656723367ca65b609a.tar.bz2 iurt-fde9537cbeb38ea78f5ad5656723367ca65b609a.tar.xz iurt-fde9537cbeb38ea78f5ad5656723367ca65b609a.zip |
use upload.conf from /etc/iurt if not in home (could be factorized together and with iurt config file code)
Diffstat (limited to 'emi')
-rwxr-xr-x | emi | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -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); |