diff options
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); |