commit a94b10ce8dc9bce8e43706ff7283173563cea32d Author: Felix Erstfeld Date: Fri Apr 21 02:43:40 2023 +0200 first commit 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