summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2018-04-19 14:03:01 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2018-04-19 14:04:40 (GMT)
commit3c4af35e7ef01f33662e515859a827091774d64a (patch) (side-by-side diff)
treed8636f9b1ad25f1713a924f169803034321e20af
parentc7c75b0cca25ecacad0ba2dfe7c41db836a0b17a (diff)
downloadacmeman-3c4af35e7ef01f33662e515859a827091774d64a.tar.gz
acmeman-3c4af35e7ef01f33662e515859a827091774d64a.tar.bz2
Make sure configuration defaults are applied and syntax rechecked after configuring file source module.
* acmeman: Call finalize after modifying configuration. * lib/App/Acmeman/Config.pm (finalize): New method. (new): Call finalize.
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xacmeman9
-rw-r--r--lib/App/Acmeman/Config.pm8
2 files changed, 11 insertions, 6 deletions
diff --git a/acmeman b/acmeman
index 37ed4dd..f21aa70 100755
--- a/acmeman
+++ b/acmeman
@@ -1,7 +1,7 @@
#!/bin/sh
-#!-*-perl-*-
-eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
- if 0; # not running under some shell
+#! -*-perl-*-
+eval 'exec perl -x -wS $0 ${1+"$@"}'
+ if 0;
# Copyright (C) 2017, 2018 Sergey Poznyakoff <gray@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
@@ -563,7 +563,7 @@ Sergey Poznyakoff <gray@gnu.org>
my $progname = basename($0);
my $progdescr = "manages ACME certificates";
-my $debug;
+my $debug = 0;
my $dry_run;
my $acme_host = 'prod';
my %acme_endpoint = (prod => 'acme-v01.api.letsencrypt.org',
@@ -1182,6 +1182,7 @@ if ($config->success) {
if ($check_alt_names) {
$config->set(qw(core check-alt-names), $check_alt_names);
}
+ $config->finalize;
}
unless ($config->success) {
diff --git a/lib/App/Acmeman/Config.pm b/lib/App/Acmeman/Config.pm
index bbe1f2b..614a46a 100644
--- a/lib/App/Acmeman/Config.pm
+++ b/lib/App/Acmeman/Config.pm
@@ -30,11 +30,15 @@ sub new {
} else {
$self->error("configuration file \"$filename\" does not exist");
}
-
+ $self->finalize;
+ return $self;
+}
+
+sub finalize {
+ my $self = shift;
if ($self->success && exists($self->{_syntax})) {
$self->_fixup($self->{_syntax}, $self->{_conf});
}
- return $self;
}
sub error {

Return to:

Send suggestions and report system problems to the System administrator.