Browse Source

adding

release/0.1
Björn 4 years ago
parent
commit
d518ab15c7
1 changed files with 12 additions and 3 deletions
  1. +12
    -3
      app/Commands/LetsEncryptAddCommand.php

+ 12
- 3
app/Commands/LetsEncryptAddCommand.php View File

@ -40,18 +40,27 @@ class LetsEncryptAddCommand extends Command
{
$domains = $this->argument('domain');
// adding flags
$domainFlags = '';
// add file for domain
$saved = [];
// create flags
foreach($domains as $domain) {
$domainFlags .= '-d '.$domain.' ';
$saved[$domain] = '/etc/letsencrypt/live/'.$domain.'/fullchain.pem';
}
exec('certbot --non-interactive --agree-tos -m '.$this->argument('email').' --nginx '.$domainFlags, $output);
$this->line(implode("\n", $output));
foreach($output as $line) {
//Congratulations!
//check for string
foreach($saved as $domain => $file) {
if (file_exists($file)) {
$this->info($domain.'...Success!');
} else {
$this->error($domain.'...Failed!');
}
}
}
}

Loading…
Cancel
Save