Added print_error and print_warning functions

This commit is contained in:
Tigerblue77 2025-01-26 14:23:55 +00:00
parent 0c18027184
commit 88167eecfb
3 changed files with 30 additions and 10 deletions

View file

@ -26,8 +26,7 @@ fi
if [[ $IDRAC_HOST == "local" ]]; then
# Check that the Docker host IPMI device (the iDRAC) has been exposed to the Docker container
if [ ! -e "/dev/ipmi0" ] && [ ! -e "/dev/ipmi/0" ] && [ ! -e "/dev/ipmidev/0" ]; then
echo "/!\ Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0, check that you added the device to your Docker container or stop using local mode. Exiting." >&2
exit 1
print_error_and_exit "Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0, check that you added the device to your Docker container or stop using local mode"
fi
IDRAC_LOGIN_STRING='open'
else
@ -39,8 +38,7 @@ fi
get_Dell_server_model
if [[ ! $SERVER_MANUFACTURER == "DELL" ]]; then
echo "/!\ Your server isn't a Dell product. Exiting." >&2
exit 1
print_error_and_exit "Your server isn't a Dell product"
fi
# If server model is Gen 14 (*40) or newer