Эх сурвалжийг харах

use certbot for gatering informations

andre 8 сар өмнө
parent
commit
a7f8f06bee

+ 3 - 10
controllers/GetSSLDaysController.php

@@ -13,7 +13,7 @@ class GetSSLDaysController {
 
         exec("sudo certbot certificates --cert-name $domain | grep 'Expiry' | sed 's/..:..:..+..:..../\n/g
 ' | sed 's/days)//g' | sed 's/[[:space:]]//g' | cut -d:  -f2", $phpOutput, $phpReturnCode);
-        
+        $sslData = implode("\n",$phpOutput);
         /*
         $certFile = "/etc/letsencrypt/live/$domain/fullchain.pem";
         if (!file_exists($certFile)) {
@@ -34,17 +34,10 @@ class GetSSLDaysController {
         $expiryDate = date('Y-m-d', $expiryTimestamp);
         $daysRemaining = ceil(($expiryTimestamp - time()) / 86400);
         */
-		logModuleCall(
-			'siteBuilder',
-			__FUNCTION__,
-			$data,
-			'Debug',
-			$phpOutput
-		);
 
         echo json_encode([
-	        'ssl_expiry' => $phpOutput,
-	        'ssl_remaining' => $phpOutput
+	        'ssl_expiry' => $sslData[0],
+	        'ssl_remaining' => $sslData[1]
 	    ]);
 
     }