Merge pull request #41 from tigerblue77/5-the-container-fails-silently-when-used-with-local-idrac-without-specifying-the-ipmi-device

Added IPMI device presence check in local mode
This commit is contained in:
Tigerblue77 2023-02-04 15:17:24 +01:00 committed by GitHub
commit 8369277107
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,6 +74,11 @@ echo "iDRAC/IPMI host: $IDRAC_HOST"
# Check if the iDRAC host is set to 'local' or not then set the IDRAC_LOGIN_STRING accordingly # Check if the iDRAC host is set to 'local' or not then set the IDRAC_LOGIN_STRING accordingly
if [[ $IDRAC_HOST == "local" ]] if [[ $IDRAC_HOST == "local" ]]
then 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
fi
IDRAC_LOGIN_STRING='open' IDRAC_LOGIN_STRING='open'
else else
echo "iDRAC/IPMI username: $IDRAC_USERNAME" echo "iDRAC/IPMI username: $IDRAC_USERNAME"