Echo ipmi temp to /tmp for use in home assistant

This commit is contained in:
Marko Korhonen 2020-02-17 13:22:21 +02:00
parent 4014bd7671
commit 2da55dc5bd
3 changed files with 13 additions and 14 deletions

View file

@ -1,12 +1,14 @@
#!/bin/bash
IPMIHOST=10.0.0.174
IPMIHOST=10.0.0.82
IPMIUSER=ReekyMarko
IPMIPW={{@@ env['PASS_IPMI'] @@}}
IPMIEK=0000000000000000000000000000000000000000
MAXTEMP=27
TEMP=$(ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK sdr type temperature |grep Ambient |grep degrees |grep -Po '\d{2}' | tail -1)
echo $TEMP > /tmp/idrac-temp
if [[ $TEMP > $MAXTEMP ]];
then