~ubuntu-branches/debian/wheezy/byobu/wheezy

« back to all changes in this revision

Viewing changes to usr/lib/byobu/fan_speed

  • Committer: Package Import Robot
  • Author(s): Alexander Chernyakhovsky
  • Date: 2012-03-12 00:57:42 UTC
  • mfrom: (0.6.1) (0.1.176 precise)
  • Revision ID: package-import@ubuntu.com-20120312005742-barjtu40fv60w64m
Tags: 5.16-1
Syncing from Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
        for i in $FAN /sys/class/hwmon/*/*/fan1_input /sys/class/hwmon/*/device/hwmon/*/fan1_input; do
32
32
                [ -f "$i" ] || continue
33
33
                read speed < "$i"
34
 
                if [ "$speed" -gt 0 ]; then
 
34
                if [ -n "$speed" ] && [ "$speed" -gt 0 ]; then
35
35
                        color bold1; printf "%s" "$speed"; color -; color none; printf "rpm"; color --
36
36
                        return 0
37
37
                fi
43
43
                read line < /proc/i8k
44
44
                set -- $line
45
45
                for speed in $7 $8; do
46
 
                        if [ "$speed" -gt 0 ]; then
 
46
                        if [ -n "$speed" ] && [ "$speed" -gt 0 ]; then
47
47
                                # I8K_FAN_MULT defaults to 30 (buggy BIOS workaround?),
48
48
                                # use `modprobe i8k fan_mult=1` to disable if unneeded,
49
49
                                # resulting in nonsensical speeds