Working on neomutt setup and some other small fixes

This commit is contained in:
Marko Korhonen 2020-11-25 10:06:19 +02:00
parent ef6050fed3
commit a38b58d91a
No known key found for this signature in database
GPG key ID: 911B85FBC6003FE5
36 changed files with 152 additions and 155 deletions

19
scripts/ipmi/temp.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/bash
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)
mosquitto_pub -u reekynet -P {{@@ env['PASS_MQTT'] @@}} -t "ipmi/temp" -m "$TEMP"
if [[ $TEMP > $MAXTEMP ]];
then
printf "Warning: Temperature is too high! Activating dynamic fan control! ($TEMP C)"
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK raw 0x30 0x30 0x01 0x01
else
printf "Temperature is OK ($TEMP C)"
fi