From 1fd03997a52732239cab73446498ffc195b2d128 Mon Sep 17 00:00:00 2001 From: Bozhidar Date: Mon, 4 Nov 2024 16:45:26 +0200 Subject: [PATCH] Update LetsEncryptSecureDomain.php --- web/Modules/LetsEncrypt/Jobs/LetsEncryptSecureDomain.php | 7 +++++++ 1 file changed, 7 insertions(+) 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 = [];