From 3046895dd45aa327fef9328814cb74100f2b17ff Mon Sep 17 00:00:00 2001 From: hael Date: Wed, 12 Mar 2025 00:27:15 +0100 Subject: [PATCH] check_letsencrypt --- functions.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/functions.php b/functions.php index e655917..a4e136a 100644 --- a/functions.php +++ b/functions.php @@ -294,6 +294,29 @@ function check_files($dir,$key) { return $result; } +function check_letsencrypt() { + + global $SHARED_DIR; + + $input_file = $SHARED_DIR."/output/letsencrypt.json"; + if (file_exists($input_file)) { + $json_data = file_get_contents($input_file); + $data = json_decode($json_data,true); + if ($data === null) { + echo "JSON read error..."; + // TODO json error + } + else { + foreach ($data as $d) { + $result[$d["domain"]] = $d; + } + } + } + else $result = ""; + + return $result; +} + function check_request($key="") { global $INTERFACE;