diff options
Diffstat (limited to 'thermal/thermal_03.sh')
-rwxr-xr-x | thermal/thermal_03.sh | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/thermal/thermal_03.sh b/thermal/thermal_03.sh index 4bb3982..86bdffd 100755 --- a/thermal/thermal_03.sh +++ b/thermal/thermal_03.sh @@ -29,7 +29,7 @@ source ../include/functions.sh source ../include/thermal_functions.sh CPU_HEAT_BIN=../utils/heat_cpu -GPU_HEAT_BIN=glmark2 +GPU_HEAT_BIN=/usr/bin/glmark2 check_temperature_change() { local dirpath=$THERMAL_PATH/$1 @@ -41,11 +41,18 @@ check_temperature_change() { local init_temp=$(cat $dirpath/temp) $CPU_HEAT_BIN & cpu_pid=$(ps | grep heat_cpu| awk '{print $1}') + test -z $cpu_pid && cpu_pid=0 check "start cpu heat binary" "test $cpu_pid -ne 0" - $GPU_HEAT_BIN & - gpu_pid=$(ps | grep $GPU_HEAT_BIN| awk '{print $1}') + if [ -x $GPU_HEAT_BIN ]; then + $GPU_HEAT_BIN & + gpu_pid=$(ps | grep $GPU_HEAT_BIN| awk '{print $1}') + test -z $gpu_pid && gpu_pid=0 + else + echo "glmark2 not found." 1>&2 + fi check "start gpu heat binary" "test $gpu_pid -ne 0" + sleep 5 local final_temp=$(cat $dirpath/temp) if [ $cpu_pid != 0 ]; then |