diff --git a/encryption365.php b/encryption365.php index 77fcce0..338baac 100644 --- a/encryption365.php +++ b/encryption365.php @@ -448,8 +448,8 @@ class Certificate { public static function saveCert($host, $certInfo) { $info = Storage::getInfo($host); - $cert = $certInfo['cert_code']; - $caCert = $certInfo['ca_code']; + $cert = trim($certInfo['cert_code']); + $caCert = trim($certInfo['ca_code']); $startTime = $certInfo['created_at']; $endTime = $certInfo['expire_at']; $info['status'] = 'issued'; @@ -879,7 +879,7 @@ class InstallCtr { if (isset($info[$field]) && $info[$field] !== '') { switch ($field) { case 'fullchain': - $content = Storage::getCert($host) . Storage::getCaCert($host); + $content = Storage::getCert($host) . PHP_EOL . Storage::getCaCert($host); break; case 'key': $content = Storage::getPrivkey($host); diff --git a/run.sh b/run.sh index fe2e118..b918840 100755 --- a/run.sh +++ b/run.sh @@ -1 +1,5 @@ -php /etc/encryption365/encryption365.php $* +cmd="php /etc/encryption365/encryption365.php " +for i in "$@"; do + cmd="$cmd '$i'" +done +eval $cmd