From 6d9950fd61c100d381366e7fe9aa6f1c43df60c8 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Wed, 30 Sep 2009 13:17:09 -0500 Subject: [PATCH] bin/fan_speed: improve the logic for find the fan_speed system monitor LP: #439524 --- bin/fan_speed | 9 ++++++--- debian/changelog | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/fan_speed b/bin/fan_speed index 99c7eb74..c49475fa 100755 --- a/bin/fan_speed +++ b/bin/fan_speed @@ -27,7 +27,10 @@ if [ "$1" = "--detail" ]; then exit 0 fi -for i in `ls "$DIR/"*"/device/fan"* 2>/dev/null`; do - printf "\005{=b }%s\005{-}\005{= }rpm\005{-} " `cat $i` - break +for i in $(find $DIR/*/*/ -type f -name "fan1_input"); do + speed=$(cat "$i") + if [ "$speed" -gt 0 ]; then + printf "\005{=b }%s\005{-}\005{= }rpm\005{-} " "$speed" + exit 0 + fi done diff --git a/debian/changelog b/debian/changelog index b7eb64ec..3b1d1664 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ byobu (2.36) unreleased; urgency=low - * UNRELEASED + * bin/fan_speed: improve the logic for find the fan_speed system monitor + LP: #439524 - -- Dustin Kirkland Tue, 22 Sep 2009 09:40:10 -0700 + -- Dustin Kirkland Wed, 30 Sep 2009 13:16:38 -0500 byobu (2.35-0ubuntu1) karmic; urgency=low