diff options
| author | Sepero <sepero111@gmail.com> | 2014-02-09 04:20:13 -0500 |
|---|---|---|
| committer | Sepero <sepero111@gmail.com> | 2014-02-09 04:20:13 -0500 |
| commit | d616bc8399e6fac3297f00307e15add6ebd66e2e (patch) | |
| tree | ed6c459fb64476634a4526127ab098ff46445d76 | |
| parent | 17a25af364d831b551008ff5d3bccde8becce3a1 (diff) | |
Minor fix with variable naming convention.
| -rw-r--r-- | temp_throttle.sh | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/temp_throttle.sh b/temp_throttle.sh index 847ffc5..41e05bd 100644 --- a/temp_throttle.sh +++ b/temp_throttle.sh @@ -2,11 +2,10 @@ # Usage: temp_throttle.sh max_temp # USE CELSIUS TEMPERATURES. -# version 2.10 +# version 2.11 cat << EOF Author: Sepero 2013 (sepero 111 @ gmx . com) - Remote Python developer and Linux administrator for hire. URL: http://github.com/Sepero/temp-throttle/ EOF @@ -40,11 +39,11 @@ fi ### Start Initialize Global variables. # The frequency will increase when low temperature is reached. -LOW_TEMP=$(($MAX_TEMP - 5)) +LOW_TEMP=$((MAX_TEMP - 5)) CORES=$(nproc) # Get number of CPU cores. echo -e "Number of CPU cores detected: $CORES\n" -CORES=$(($CORES - 1)) # Subtract 1 from $CORES for easier counting later. +CORES=$((CORES - 1)) # Subtract 1 from $CORES for easier counting later. # Temperatures internally are calculated to the thousandth. MAX_TEMP=${MAX_TEMP}000 @@ -109,7 +108,7 @@ set_freq () { # Will reduce the frequency of cpus if possible. throttle () { if [ $CURRENT_FREQ -lt $FREQ_LIST_LEN ]; then - CURRENT_FREQ=$(($CURRENT_FREQ + 1)) + CURRENT_FREQ=$((CURRENT_FREQ + 1)) echo -n "throttle " set_freq $CURRENT_FREQ fi @@ -118,7 +117,7 @@ throttle () { # Will increase the frequency of cpus if possible. unthrottle () { if [ $CURRENT_FREQ -ne 1 ]; then - CURRENT_FREQ=$(($CURRENT_FREQ - 1)) + CURRENT_FREQ=$((CURRENT_FREQ - 1)) echo -n "unthrottle " set_freq $CURRENT_FREQ fi |
