Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- ### BEGIN INIT INFO
- # Provides: fancontrol
- # Required-Start: $local_fs
- # Required-Stop: $local_fs
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: fancontrol
- # Description: fan speed regulator
- ### END INIT INFO
- . /lib/lsb/init-functions
- [ -f /etc/default/rcS ] && . /etc/default/rcS
- PATH=/bin:/usr/bin:/sbin:/usr/sbin
- DAEMON=/usr/sbin/fancontrol
- DESC="fan speed regulator"
- NAME="fancontrol"
- PIDFILE=/var/run/fancontrol.pid
- CONF=/etc/fancontrol
- test -x $DAEMON || exit 0
- case "$1" in
- start)
- if [ -f $CONF ] && [ -n "`grep INTERVAL $CONF | cut -d= -f2`" ]; then
- log_daemon_msg "Starting $DESC" "$NAME"
- start-stop-daemon --start --quiet --background --pidfile $PIDFILE --startas $DAEMON
- log_end_msg $?
- else
- if [ "$VERBOSE" != no ]; then
- log_warning_msg "Not starting fancontrol; run pwmconfig first."
- fi
- fi
- ;;
- stop)
- log_daemon_msg "Stopping $DESC" "$NAME"
- start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo --startas $DAEMON
- log_end_msg $?
- ;;
- restart)
- $0 stop
- sleep 10
- $0 start
- ;;
- force-reload)
- if start-stop-daemon --stop --test --quiet --pidfile $PIDFILE --startas $DAEMON ; then
- $0 restart
- fi
- ;;
- *)
- log_success_msg "Usage: /etc/init.d/fancontrol {start|stop|restart|force-reload}"
- exit 1
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement