Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > aec429c80e1b148dd2893266d41a1e3c > files > 2

fnfx-0.3-1mdk.src.rpm

#!/bin/sh
#
# chkconfig: 2345 27 73
# description: apmiser is used for monitoring system usage when on batteries, \
#	scaling the CPU voltage down via tpctl when idle to save power.
# processname: apmiser

# We can't run without acpi:
[ -e /proc/acpi ] || exit

# If toshiba_acpi doesn't exist, try loading the module...
[ -e /proc/acpi/toshiba ] || /sbin/modprobe toshiba_acpi &>/dev/null

# Don't bother if /proc/acpi/toshiba still doesn't exist
[ -e /proc/acpi/toshiba ]|| exit

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

RETVAL=0

start() {
	gprintf "Starting up Toshiba function key daemon (fnfxd): "
	daemon /usr/sbin/fnfxd
	touch /var/lock/subsys/fnfxd
	echo
}

stop() {
	gprintf "Shutting down Toshiba function key daemon (fnfxd): "
	killproc fnfxd
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/fnfxd
	echo
}

dostatus() {
	status fnfxd
	RETVAL=$?
}

restart() {
	stop
	start
	RETVAL=$?
}

condrestart() {
	[ -e /var/lock/subsys/fnfxd ] && restart || :
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
	dostatus
	;;
  restart|reload)
	restart
	;;
  condrestart)
	condrestart
	;;
  *)
	gprintf "Usage: $0 {start|stop|status|restart|reload|condrestart}\n"
	exit 1
esac

exit $RETVAL