Linux开发板温度检测脚本

开发板linux,支持微信推送
适用于温度文件是【/etc/armbianmonitor/datasources/soctemp】

#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#/etc/armbianmonitor/datasources/soctemp
cur_dateTime=$(date "+%Y%m%d-%H%M%S")
board_temp=$(cat /etc/armbianmonitor/datasources/soctemp)
zc_temp=68000
echo -e $zc_temp
echo $board_temp
echo -e "$cur_dateTime----现在温度$board_temp----阀值温度$zc_temp" >> /root/wendu.log
if [ $board_temp -gt $zc_temp ]
then
echo -e "高温警告"
curl -s "https://sc.ftqq.com/SC***********************************.send?text=NAS高温警报&desp=$cur_dateTime现在温度$board_temp,超过阀值温度$zc_temp,即将重启"
reboot
else
echo -e "温度正常"
fi

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享