From 4847335cda68dd0bea333fa06c595796da3d3b3e Mon Sep 17 00:00:00 2001 From: Meliox Date: Mon, 8 Sep 2025 22:01:29 +0200 Subject: [PATCH] really require lm sensors --- pve-mod-gui-sensors.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pve-mod-gui-sensors.sh b/pve-mod-gui-sensors.sh index 44e058c..25e17f4 100644 --- a/pve-mod-gui-sensors.sh +++ b/pve-mod-gui-sensors.sh @@ -101,8 +101,8 @@ function install_packages { ;; [nN]) # If the user chooses not to install lm-sensors, exit the script with a zero status code - msg "Decided to not install lm-sensors. The mod cannot run without it. Exiting..." - exit 0 + msgb "Decided to not install lm-sensors. The mod cannot run without it. Exiting..." + err "lm-sensors is required. Exiting..." ;; *) # If the user enters an invalid input, print an error message and exit the script with a non-zero status code @@ -110,6 +110,11 @@ function install_packages { ;; esac fi + + # Check if lm-sensors is installed correctly and exit if not + if (! command -v sensors &>/dev/null); then + err "lm-sensors installation failed or 'sensors' command is not available. Please install lm-sensors manually and re-run the script." + fi } function configure {