forked from alombardo4/idrac-fan-control-docker
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from tigerblue77/80-add-docker-healthcheck-to-…
…readmemd Added Docker healthcheck to README.md
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Enable strict bash mode to stop the script if an uninitialized variable is used, if a command fails, or if a command with a pipe fails | ||
# Not working in some setups : https://github.com/tigerblue77/Dell_iDRAC_fan_controller/issues/48 | ||
# set -euo pipefail | ||
|
||
source functions.sh | ||
|
||
# Check if the iDRAC host is set to 'local' or not then set the IDRAC_LOGIN_STRING accordingly | ||
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 | ||
fi | ||
IDRAC_LOGIN_STRING='open' | ||
else | ||
echo "iDRAC/IPMI username: $IDRAC_USERNAME" | ||
echo "iDRAC/IPMI password: $IDRAC_PASSWORD" | ||
IDRAC_LOGIN_STRING="lanplus -H $IDRAC_HOST -U $IDRAC_USERNAME -P $IDRAC_PASSWORD" | ||
fi | ||
|
||
ipmitool -I $IDRAC_LOGIN_STRING sdr type temperature |