minor stuff

This commit is contained in:
Meliox 2025-09-06 14:14:11 +02:00
parent 092cdc66a5
commit 65a52a8569

View File

@ -242,7 +242,7 @@ function configure {
fi fi
# Prompt user for enabling UPS # Prompt user for enabling UPS
local choiseEnableUPS=$(ask "Do you wish to enable information from an attached UPS (requires configured UPS server and UPS client using Network UPS Tools. Both must be configured beforehand). (Y/n)") local choiseEnableUPS=$(ask "Do you wish to enable information from an attached UPS (requires configured UPS server and installed UPS client from Network UPS Tools already configured beforehand). (Y/n)")
case "$choiseEnableUPS" in case "$choiseEnableUPS" in
[yY] | "") [yY] | "")
# Test the connection using upsc command # Test the connection using upsc command
@ -253,6 +253,11 @@ function configure {
else else
# Prompt user for UPS connection details # Prompt user for UPS connection details
upsConnection=$(ask "Enter connection details for the UPS (e.g., upsname[@hostname[:port]])") upsConnection=$(ask "Enter connection details for the UPS (e.g., upsname[@hostname[:port]])")
if (! command -v upsc &>/dev/null); then
err "The 'upsc' command is not available. Please install the 'nut-client' package and ensure it is configured correctly. Exiting..."
fi
upsOutput=$(upsc "$upsConnection" 2>&1) upsOutput=$(upsc "$upsConnection" 2>&1)
fi fi
@ -279,6 +284,7 @@ function configure {
ENABLE_UPS=false ENABLE_UPS=false
;; ;;
esac esac
echo ""
# DMI Type: # DMI Type:
# 1 ... System Information # 1 ... System Information