Comment 47 for bug 77370

Revision history for this message
Akdo (menoft) wrote :

Hi, there is a mistake on script.

The fact is that you cannot put on fan 2 before doing the 3 one on !

And please dont create files !
So you must follow some rules :

#!/bin/sh
#
# 99funguj: sprav co se da

case "$1" in
 hibernate|suspend)
  # Stopping is not required.
  ;;
 thaw|resume)

  for x in /proc/acpi/fan/*; do
      if [ -f "$x/state" ] && [ "`grep on $x/state`" ]; then
          echo -n 3 > $x/state; # ok désactive
      fi
  done

  for x in /proc/acpi/fan/*; do
      if [ -f "$x/state" ] && [ "`grep on $x/state`" ]; then
echo -n 0 > $x/state; # not ok ! active
      fi
  done

  for x in /proc/acpi/fan/*; do
       if [ -f "$x/state" ] && [ "`grep off $x/state`" ]; then
            echo "echo -n 0 > $x/state;" >> /tmp/fanstate0
            echo "echo -n 3 > $x/state;" >> /tmp/fanstate3
       fi
   done
  ;;
 *) exit $NA
  ;;
esac