diff --git a/web/Modules/LetsEncrypt/Jobs/LetsEncryptSecureDomain.php b/web/Modules/LetsEncrypt/Jobs/LetsEncryptSecureDomain.php index c48ec33..299ceeb 100644 --- a/web/Modules/LetsEncrypt/Jobs/LetsEncryptSecureDomain.php +++ b/web/Modules/LetsEncrypt/Jobs/LetsEncryptSecureDomain.php @@ -39,6 +39,11 @@ class LetsEncryptSecureDomain 'organization' => $generalSettings['organization_name'], ])->render(); + $isCertbotInstalled = shell_exec('which certbot'); + if (empty($isCertbotInstalled)) { + shell_exec('sudo apt install certbot -y'); + } + $tmpFile = '/tmp/certbot-http-secure-command-'.$findDomain->id.'.sh'; file_put_contents($tmpFile, $certbotHttpSecureCommand); shell_exec('chmod +x '.$tmpFile); @@ -46,6 +51,8 @@ class LetsEncryptSecureDomain shell_exec('chmod +x /usr/local/phyre/web/Modules/LetsEncrypt/shell/hooks/post/http-cleanup.sh'); $exec = shell_exec("bash $tmpFile"); + sleep(10); + unlink($tmpFile); $validateCertificates = [];