Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > d0eb31eda128b90941f55fc4a0a333ec > files > 3

pbbuttonsd-0.5.2-1mdk.src.rpm

#! /bin/sh
#
# pbbuttonsd   Power Book Buttons daemon.
#
# chkconfig: 2345 73 61
# description: A special Tool for Apple PowerBook owner. It makes \
#              the keys for controlling the brightness and volume work \
#              as expected. It also controls trackpad settings and do \
#              basic power management.
# processname: pbbuttonsd 
# config: /etc/pbbuttonsd.conf

# Source function library.
. /etc/rc.d/init.d/functions

# If the machine is not a laptop, bail out elegantly.
MACHINE=`cat /proc/cpuinfo | grep machine | awk '{print $3}' | grep Book`

if [ -z "$MACHINE" ]; then
        gprintf "Bypassing pbbuttonsd daemon, not a laptop: "
        echo
        exit 0
fi

# See how we were called.
case "$1" in
  start)
  	action "Loading event module (evdev):" modprobe evdev
	gprintf "Starting pbbuttonsd daemon: "
	daemon pbbuttonsd -d 
	echo
	touch /var/lock/subsys/pbbuttonsd
	;;
  stop)
	gprintf "Stopping pbbutonsd daemon: "
	killproc pbbuttonsd
	echo
	rm -f /var/lock/subsys/pbbuttonsd
	;;
  reload|restart)
  	$0 stop
        $0 start
        ;;
  status)
	status pbbuttonsd
	;;
  *)
	gprintf "Usage: pbbuttonsd {start|stop|restart|reload|status}\n"
	exit 1
esac

exit 0