mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
security/acme-client: fix command failure with gcloud, refs #3745
This commit is contained in:
@@ -8,6 +8,9 @@ WWW: https://github.com/acmesh-official/acme.sh
|
||||
Plugin Changelog
|
||||
================
|
||||
|
||||
Fixed:
|
||||
* fix sporadic command failure with gcloud DNS API (#3745)
|
||||
|
||||
3.20
|
||||
|
||||
Added:
|
||||
|
||||
@@ -194,10 +194,19 @@ class LeUtils
|
||||
|
||||
// Make sure the resource could be setup properly
|
||||
if (is_resource($proc)) {
|
||||
// Close all pipes
|
||||
// This workaround ensures that the accurate return code
|
||||
// is reliably returned.
|
||||
fclose($proc_pipes[0]);
|
||||
$output = array();
|
||||
while (!feof($proc_pipes[1])) {
|
||||
$output[] = rtrim(fgets($proc_pipes[1], 1024), "\n");
|
||||
}
|
||||
fclose($proc_pipes[1]);
|
||||
while (!feof($proc_pipes[2])) {
|
||||
$output[] = rtrim(fgets($proc_pipes[2], 1024), "\n");
|
||||
}
|
||||
fclose($proc_pipes[2]);
|
||||
|
||||
// Get exit code
|
||||
$result = proc_close($proc);
|
||||
log_error(sprintf("AcmeClient: The shell command returned exit code '%d': '%s'", $result, $proc_cmd));
|
||||
|
||||
Reference in New Issue
Block a user