--- laptop-mode.orig 2006-08-28 17:19:38.000000000 +0300 +++ laptop-mode 2006-08-28 17:28:16.000000000 +0300 @@ -3,41 +3,48 @@ . /etc/rc.conf . /etc/rc.d/functions +DAEMON=/usr/sbin/laptop_mode +CHK_FILE=/var/run/laptop-mode-enabled -test -f /usr/sbin/laptop_mode || exit 0 +test -x $DAEMON || exit 0 case "$1" in start) - stat_busy "Starting laptop-mode" - touch /var/run/laptop-mode-enabled - /usr/sbin/laptop_mode auto init > /dev/null + stat_busy "Starting laptop-mode:" + touch $CHK_FILE + echo -n " `$DAEMON auto init`" if [ $? -gt 0 ]; then stat_fail else - add_daemon acpid + add_daemon laptop-mode stat_done fi ;; stop) - stat_busy "Stopping laptop-mode" - rm -f /var/run/laptop-mode-enabled - /usr/sbin/laptop_mode stop init > /dev/null + stat_busy "Stopping laptop-mode:" + rm -f $CHK_FILE + echo -n " `$DAEMON stop init`" if [ $? -gt 0 ]; then stat_fail else - rm_daemon acpid + rm_daemon laptop-mode stat_done fi ;; restart) - $0 stop - $0 start + stat_busy "Restarting laptop-mode:" + echo -n " `$DAEMON auto init force`" + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi ;; status) - /usr/sbin/laptop_mode status + $DAEMON status ;; *) - echo "Usage: $0 {stop|start|restart|status}" + echo "Usage: $0 {stop|start|restart|status}" ;; esac exit 0