Skip to content

Commit a2d46b6

Browse files
author
Stanislav Humplik
committed
Fixing #7 - check for existing registration
1 parent 1027837 commit a2d46b6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Lescript.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ public function __construct($certificatesDir, $webRootDir, $logger)
2727

2828
public function initAccount()
2929
{
30-
$this->logger->info('Starting new account registration');
30+
if(!is_file($this->accountKeyPath)) {
3131

32-
// generate and save new private key for account
33-
// ---------------------------------------------
32+
// generate and save new private key for account
33+
// ---------------------------------------------
3434

35-
if(!is_file($this->accountKeyPath)) {
35+
$this->logger->info('Starting new account registration');
3636
$this->generateKey(dirname($this->accountKeyPath));
37-
}
37+
$this->postNewReg();
38+
$this->logger->info('New account certificate registered');
3839

39-
// send registration
40-
// -----------------
40+
} else {
4141

42-
$this->postNewReg();
42+
$this->logger->info('Account already registered. Continuing.');
4343

44-
$this->logger->info('New account certificate registered');
44+
}
4545
}
4646

4747
public function signDomains(array $domains)

0 commit comments

Comments
 (0)