diff options
| author | Sepero <Sepero@users.noreply.github.com> | 2019-01-09 20:10:00 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-09 20:10:00 -0500 |
| commit | 82517aae631d96714c4e8b0ac926e26b51d72252 (patch) | |
| tree | 7922717065ecba045f4f99e07cc468ee1a5e3e67 | |
| parent | 4199e7ec107d50e5fcdbf1d4a012174d8913835b (diff) | |
| parent | fe04105060d52215dae8c6dc48dfc4a72fbf9414 (diff) | |
| download | temp-throttle-82517aae631d96714c4e8b0ac926e26b51d72252.tar.gz | |
Merge pull request #34 from marco44/marco44_improvements
Small improvements:
| -rwxr-xr-x | temp_throttle.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/temp_throttle.sh b/temp_throttle.sh index 8d4f7d1..be0209f 100755 --- a/temp_throttle.sh +++ b/temp_throttle.sh @@ -56,7 +56,7 @@ FREQ_MAX="/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" # Store available cpu frequencies in a space separated string FREQ_LIST. if [ -f $FREQ_FILE ]; then # If $FREQ_FILE exists, get frequencies from it. - FREQ_LIST=$(cat $FREQ_FILE) || err_exit "Could not read available cpu frequencies from file $FREQ_FILE" + FREQ_LIST=$(cat $FREQ_FILE | xargs -n1 | sort -g -r | xargs) || err_exit "Could not read available cpu frequencies from file $FREQ_FILE" elif [ -f $FREQ_MIN -a -f $FREQ_MAX ]; then # Else if $FREQ_MIN and $FREQ_MAX exist, generate a list of frequencies between them. FREQ_LIST=$(seq $(cat $FREQ_MAX) -100000 $(cat $FREQ_MIN)) || err_exit "Could not compute available cpu frequencies" @@ -132,9 +132,9 @@ unthrottle () { } get_temp () { - # Get the system temperature. + # Get the system temperature. Take the max of all counters - TEMP=$(cat $TEMP_FILE) + TEMP=$(cat $TEMPERATURE_FILES 2>/dev/null | xargs -n1 | sort -g -r | head -1) } ### END define script functions. |
