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 {