Skip to content

Commit c30bbad

Browse files
committed
Added IPMI device presence check in local mode
1 parent 9f320e5 commit c30bbad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Dell_iDRAC_fan_controller.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ echo "iDRAC/IPMI host: $IDRAC_HOST"
7474
# Check if the iDRAC host is set to 'local' or not then set the IDRAC_LOGIN_STRING accordingly
7575
if [[ $IDRAC_HOST == "local" ]]
7676
then
77+
# Check that the Docker host IPMI device (the iDRAC) has been exposed to the Docker container
78+
if [ ! -e "/dev/ipmi0" ] && [ ! -e "/dev/ipmi/0" ] && [ ! -e "/dev/ipmidev/0" ]; then
79+
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
80+
exit 1
81+
fi
7782
IDRAC_LOGIN_STRING='open'
7883
else
7984
echo "iDRAC/IPMI username: $IDRAC_USERNAME"

0 commit comments

Comments
 (0)