Skip to content
Permalink
Browse files

Allow copy of cert to service that isn't setup yet https://www.virtua…

  • Loading branch information...
jcameron committed Mar 25, 2019
1 parent 007809a commit 09158c6beff53fa19c6f14116c14231b65912cae
Showing with 6 additions and 3 deletions.
  1. +5 −0 copycert-lib.pl
  2. +1 −3 install-service-cert.pl
@@ -1,5 +1,10 @@
# Functions for copying SSL certs to other servers

sub list_service_ssl_cert_types
{
return ('webmin', 'usermin', 'dovecot', 'postfix', 'proftpd');
}

# get_all_service_ssl_certs(&domain, include-per-ip-certs)
# Returns a list of all SSL certs used by global services like Postfix
sub get_all_service_ssl_certs
@@ -55,16 +55,14 @@ package virtual_server;
@services || &usage("No services to copy the cert to specified");

# Do the specified services exist?
@svcs = &get_all_service_ssl_certs($d, 0);
%svcnames = map { $_->{'id'}, $_ } @svcs;
%svcnames = map { $_, 1 } &list_service_ssl_cert_types();
foreach my $s (@services) {
$svcnames{$s} || &usage("Invalid service $s. Valid services are ".
join(" ", keys %svcnames));
}

# Copy to each of them
foreach my $s (@services) {
$svc = $svcnames{$s};
&$first_print("Copying to service $s ..");
&$indent_print();
$func = "copy_".$s."_ssl_service";

0 comments on commit 09158c6

Please sign in to comment.
You can’t perform that action at this time.