X-Git-Url: https://git.rapsys.eu/acme/blobdiff_plain/4ae894f1b340be86ea138f9dbaa9a80e901312dd..2143e273c43cb7ef1b311f725f3f80f3fa67728b:/gencert diff --git a/gencert b/gencert index 42af919..ff77f24 100755 --- a/gencert +++ b/gencert @@ -10,12 +10,15 @@ use acme; # Load POSIX use POSIX qw(EXIT_SUCCESS EXIT_FAILURE); -#XXX: debug -use Data::Dumper; +# Init debug +my $debug = 0; # Init prod my $prod = 0; +# Strip and enable debug +@ARGV = map { if ($_ eq '-d') { $debug = 1; (); } else { $_; } } @ARGV; + # Strip and enable prod @ARGV = map { if ($_ eq '-p') { $prod = 1; (); } else { $_; } } @ARGV; @@ -26,10 +29,10 @@ if (scalar(@ARGV) < 2) { } # Create new object -my $acme = acme->new(shift @ARGV, @ARGV); +my $acme = acme->new(shift @ARGV, $debug, $prod, @ARGV); # Prepare environement -$acme->prepare($prod); +$acme->prepare(); # Generate required keys $acme->genKeys(); @@ -38,13 +41,13 @@ $acme->genKeys(); $acme->genCsr(); # Directory -$acme->directory($prod); +$acme->directory(); # Register $acme->register(); # Authorize -$acme->authorize($prod); +$acme->authorize(); # Issue $acme->issue();