Difference between revisions of "Code/fan-enable.init"

From ThinkWiki
Jump to: navigation, search
 
(remove spam)
 
(One intermediate revision by one other user not shown)
(No difference)

Latest revision as of 18:11, 18 December 2006

  1. !/bin/sh

N=/etc/init.d/fan

set -e

case "$1" in

start)
      # make sure privileges don't persist across reboots
      if [ -d /var/run/fan ] && [ "x`ls /var/run/fan`" != x ]
      then
              touch -t 198501010000 /var/run/fan/*
      fi
      fan.sh &    # Script from above
      ;;
stop|reload|restart|force-reload)
      killall fan.sh
      echo enable > /proc/acpi/ibm/fan
      ;;
*)
      echo "Usage: $N {start|stop|restart|force-reload}" >&2
      exit 1
      ;;

esac

exit 0