simple cli for tuxedo laptop N150ZU

fancontrol.init 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #! /bin/bash
  2. #
  3. ### BEGIN INIT INFO
  4. # Provides: fancontrol
  5. # Required-Start: $syslog
  6. # Required-Stop: $syslog
  7. # Should-Start: $syslog
  8. # Should-Stop: $syslog
  9. # Default-Start: 2 3 4 5
  10. # Default-Stop: 0 1 6
  11. # Short-Description: Start fancontrol loop
  12. # Description: Simple version
  13. ### END INIT INFO
  14. # Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
  15. #set -e
  16. # Must be a valid filename
  17. NAME=fancontrol
  18. PIDFILE=/var/run/$NAME.pid
  19. #This is the command to be run, give the full pathname
  20. DAEMON=/usr/local/bin/autofan
  21. DAEMON_OPTS=""
  22. . /lib/lsb/init-functions
  23. export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
  24. case "$1" in
  25. start)
  26. log_begin_msg "Starting daemon" $NAME
  27. start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --no-close --exec $DAEMON > >(logger -p daemon.info -t $NAME) 2>&1
  28. ;;
  29. stop)
  30. log_begin_msg "Stopping daemon" $NAME
  31. start-stop-daemon --stop --quiet --pidfile $PIDFILE > >(logger -p daemon.info -t $NAME) 2>&1
  32. ;;
  33. restart)
  34. $0 stop
  35. sleep 1
  36. $0 start
  37. ;;
  38. *)
  39. echo "Usage: "$1" {start|stop|restart}"
  40. exit 1
  41. esac
  42. log_end_msg $?
  43. exit 0