From a94b10ce8dc9bce8e43706ff7283173563cea32d Mon Sep 17 00:00:00 2001 From: Felix Erstfeld Date: Fri, 21 Apr 2023 02:43:40 +0200 Subject: [PATCH] first commit --- README.md | 3 +++ index.php | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 README.md create mode 100644 index.php diff --git a/README.md b/README.md new file mode 100644 index 0000000..f4193ce --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# LM-Sensors-JSON + +Ein PHP Script, welches aus den Sensordaten des Linux Paketes LM-Sensors eine JSON Datei ausgibt. diff --git a/index.php b/index.php new file mode 100644 index 0000000..4c214eb --- /dev/null +++ b/index.php @@ -0,0 +1,65 @@ + $item[1])); + } + else + $block_title = $item; + } + $json_array = array_merge($json_array, array($block_title => $block_json_array)); + } + return json_encode($json_array); +} + + +header('Content-Type: application/json'); + +echo generate_json(get_blocks(get_lines($sensor_data))); \ No newline at end of file