From 14d91bded5045c85b14c24e4364fd4e260e0c7a0 Mon Sep 17 00:00:00 2001 From: dnomd343 Date: Sat, 23 Oct 2021 18:11:29 +0800 Subject: [PATCH] fix: missing quotes in shell --- encryption365.php | 6 +++--- run.sh | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) 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