Commit 4a95363a authored by Marius Burkard's avatar Marius Burkard

- allow return code 2 on acme (non-changed domain)

parent 73e6c724
......@@ -376,8 +376,10 @@ class letsencrypt {
unset($aliasdomains);
$letsencrypt_cmd = '';
$allow_return_codes = null;
if($use_acme) {
$letsencrypt_cmd = $this->get_acme_command($temp_domains, $key_file, $bundle_file, $crt_file);
$allow_return_codes = array(2);
} else {
$letsencrypt_cmd = $this->get_certbot_command($temp_domains);
}
......@@ -388,7 +390,7 @@ class letsencrypt {
$app->log("Create Let's Encrypt SSL Cert for: $domain", LOGLEVEL_DEBUG);
$app->log("Let's Encrypt SSL Cert domains: $cli_domain_arg", LOGLEVEL_DEBUG);
$success = $app->system->_exec($letsencrypt_cmd);
$success = $app->system->_exec($letsencrypt_cmd, $allow_return_codes);
} else {
$app->log("Migration mode active, skipping Let's Encrypt SSL Cert creation for: $domain", LOGLEVEL_DEBUG);
$success = true;
......
......@@ -1672,14 +1672,24 @@ class system{
}
function _exec($command) {
function _exec($command, $return_codes_ok = null) {
global $app;
if(!is_null($return_codes_ok) && !is_array($return_codes_ok)) {
$return_codes_ok = array($return_codes_ok);
}
$out = array();
$ret = 0;
$app->log('exec: '.$command, LOGLEVEL_DEBUG);
exec($command, $out, $ret);
if($ret != 0) return false;
else return true;
if($ret == 0) {
return true;
} elseif(is_array($return_codes_ok) && !empty($return_codes_ok) && in_array($ret, $return_codes_ok)) {
return true;
} else {
return false;
}
}
//* Check if a application is installed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment