Changeset 5749

Show
Ignore:
Timestamp:
07/03/09 21:37:22 (5 years ago)
Author:
khali
Message:

Exit immediately if not root.

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r5742 r5749  
    11lm-sensors CHANGES file 
    22----------------------- 
     3 
     4SVN-HEAD 
     5  pwmconfig: Exit immediately if not root 
    36 
    473.1.1 (2009-06-21) 
  • lm-sensors/trunk/prog/pwm/pwmconfig

    r5630 r5749  
    4343fi 
    4444 
     45if [ "`id -u`" != "0" ] 
     46then 
     47        echo "You need to be root to run this script." 
     48        exit 1 
     49fi 
     50 
    4551echo "# pwmconfig revision $REVISION ($REVDATE)" 
    4652echo 'This program will search your sensors for pulse width modulation (pwm)' 
     
    259265                fi 
    260266        else 
    261                 NOTROOT=1 
     267                echo "Can't write to $i, skipping." 
    262268        fi 
    263269done 
     
    300306        echo 'You may also need to increase the fan divisors.' 
    301307        echo 'See doc/fan-divisors for more information.' 
    302         exit 1 
    303 fi 
    304  
    305 if [ "$NOTROOT" = "1" ] 
    306 then 
    307         echo 'As you are not root, we cannot write the PWM settings.' 
    308         echo 'Please run as root to continue.' 
    309308        exit 1 
    310309fi