Skip to content

Commit

Permalink
0.5-64 autofans hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
dimafern committed Jul 13, 2018
1 parent fe6835d commit 829182b
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions hive/sbin/autofan
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ unable_to_set_fan_speed=0
temperature_is_unreal=0
#unparsable data
error_in_temp_readings=0
#unparsable data
error_in_temp_readings=0

###
# Log write
Expand Down Expand Up @@ -403,17 +405,27 @@ auto_fan_control() {
echo2 "${GREEN}$(date +"%Y-%m-%d %T")${NOCOLOR}"
#echo2 "${GREEN}¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯${NOCOLOR}"
#check if exist .conf

declare -a temperatures_array=(`cat $gpu_stats_json | tail -1 | jq -r ".temp | .[]"`)

#reboot if temperatures_array is empty
if [[ $REBOOT_ON_ERROR == 1 && -z $temperatures_array || $temperatures_array == 'null' ]]; then
local msg="Autofan: GPU driver error, rebooting"
local payload=`cat $gpu_stats_json | jq -r -C .`
echo "$payload" | message err "$msg" payload
nohup bash -c 'sreboot' > /tmp/nohup.log 2>&1 &
if [[ -z $temperatures_array || $temperatures_array == 'null' ]]; then
if [[ $REBOOT_ON_ERROR == 1 ]]; then
local msg="Autofan: GPU driver error, no temps, rebooting"
local payload=`cat $gpu_stats_json | jq -r -C .`
echo "$payload" | message err "$msg" payload
nohup bash -c 'sreboot' > /tmp/nohup.log 2>&1 &
else
if [[ $error_in_temp_readings == 0 ]]; then
local msg="Autofan: GPU driver error, no temps"
local payload=`cat $gpu_stats_json | jq -r -C .`
echo "$payload" | message warning "$msg" payload
fi
fi
error_in_temp_readings=1
read -t $SLEEP_TIME
continue
fi
#


if [[ -n $TARGET_TEMP && -f $CONF_FILE && -f $gpu_stats_json ]]; then
#MIN_TEMP=$(( TARGET_TEMP-5 ))
Expand Down Expand Up @@ -441,10 +453,9 @@ auto_fan_control() {
echo2 "$gpu_info"

declare -a temperatures_array_previous=(${temperatures_array[@]})

fi

#miner_stop will be work
#miner_stop will be work
check_overheat

#sleep $SLEEP_TIME
Expand Down

0 comments on commit 829182b

Please sign in to comment.