File tree Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -1066,10 +1066,7 @@ check_platform_profile () {
10661066}
10671067
10681068# check prerequisites and initialize
1069- cmd_exists " $TLP " || {
1070- printf_msg " Error: %s not installed." " $TLP "
1071- exit 254
1072- }
1069+ check_tlp
10731070_cpu_driver=$( read_sysf " ${CPU0} /cpufreq/scaling_driver" ) || {
10741071 printf_msg " Error: could not determine cpu scaling driver."
10751072 exit 128
Original file line number Diff line number Diff line change @@ -34,9 +34,12 @@ cache_root_cred () {
3434 sudo true
3535}
3636
37- cmd_exists () {
38- # test if command exists -- $1: command
39- command -v " $1 " > /dev/null 2>&1
37+ check_tlp () {
38+ # test if tlp installed
39+ if [ ! -f /usr/sbin/tlp ]; then
40+ printf_msg " Error: %s not installed." " $TLP " 1>&2
41+ exit 254
42+ fi
4043}
4144
4245read_sysf () {
Original file line number Diff line number Diff line change @@ -401,12 +401,7 @@ check_amd_gpu_abm_level () {
401401}
402402
403403# check prerequisites and initialize
404- cmd_exists " $TLP " || {
405- printf_msg " Error: %s not installed." " $TLP "
406- exit 254
407- }
408- cache_root_cred
409-
404+ check_tlp
410405start_report
411406
412407# shellcheck disable=SC2034
You can’t perform that action at this time.
0 commit comments