diff --git a/app/Commands/LetsEncryptAddCommand.php b/app/Commands/LetsEncryptAddCommand.php index b51c8d5..8d3ba56 100644 --- a/app/Commands/LetsEncryptAddCommand.php +++ b/app/Commands/LetsEncryptAddCommand.php @@ -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!'); + } } } }