Guest User

MilitantPotato

a guest
Feb 24th, 2010
621
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/sh
  2.  
  3. ### BEGIN INIT INFO
  4. # Provides: fancontrol
  5. # Required-Start: $local_fs
  6. # Required-Stop: $local_fs
  7. # Default-Start: 2 3 4 5
  8. # Default-Stop: 0 1 6
  9. # Short-Description: fancontrol
  10. # Description: fan speed regulator
  11. ### END INIT INFO
  12.  
  13. . /lib/lsb/init-functions
  14.  
  15. [ -f /etc/default/rcS ] && . /etc/default/rcS
  16. PATH=/bin:/usr/bin:/sbin:/usr/sbin
  17. DAEMON=/usr/sbin/fancontrol
  18. DESC="fan speed regulator"
  19. NAME="fancontrol"
  20. PIDFILE=/var/run/fancontrol.pid
  21. CONF=/etc/fancontrol
  22.  
  23. test -x $DAEMON || exit 0
  24.  
  25. case "$1" in
  26. start)
  27. if [ -f $CONF ] && [ -n "`grep INTERVAL $CONF | cut -d= -f2`" ]; then
  28. log_daemon_msg "Starting $DESC" "$NAME"
  29.  
  30. start-stop-daemon --start --quiet --background --pidfile $PIDFILE --startas $DAEMON
  31. log_end_msg $?
  32. else
  33. if [ "$VERBOSE" != no ]; then
  34. log_warning_msg "Not starting fancontrol; run pwmconfig first."
  35. fi
  36. fi
  37. ;;
  38. stop)
  39. log_daemon_msg "Stopping $DESC" "$NAME"
  40. start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo --startas $DAEMON
  41. log_end_msg $?
  42. ;;
  43. restart)
  44. $0 stop
  45. sleep 10
  46. $0 start
  47. ;;
  48. force-reload)
  49. if start-stop-daemon --stop --test --quiet --pidfile $PIDFILE --startas $DAEMON ; then
  50. $0 restart
  51. fi
  52. ;;
  53. *)
  54. log_success_msg "Usage: /etc/init.d/fancontrol {start|stop|restart|force-reload}"
  55. exit 1
  56. ;;
  57. esac
  58.  
  59. exit 0
RAW Paste Data