aboutsummaryrefslogtreecommitdiffstats
path: root/emi
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2010-11-23 21:52:12 +0000
committerOlivier Blin <blino@mageia.org>2010-11-23 21:52:12 +0000
commitfde9537cbeb38ea78f5ad5656723367ca65b609a (patch)
treeaa4372a52168478afb011d740854d34cc03b0267 /emi
parent72a3d5b8f557fe5cafde720e0056e9d152a03f38 (diff)
downloadiurt-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-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);