aboutsummaryrefslogtreecommitdiffstats
path: root/emi
diff options
context:
space:
mode:
Diffstat (limited to 'emi')
-rwxr-xr-xemi19
1 files changed, 11 insertions, 8 deletions
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);