From: pbern Date: Sun, 10 Oct 2004 11:16:42 +0000 (+0000) Subject: - init X-Git-Tag: auto/ac/fnfx-0_3-1~8 X-Git-Url: http://git.pld-linux.org/?p=packages%2Ffnfx.git;a=commitdiff_plain;h=7da20cfc59383c08f1ced6299df732bde68ffc96 - init Changed files: fnfx.init -> 1.1 --- diff --git a/fnfx.init b/fnfx.init new file mode 100644 index 0000000..c07f9e2 --- /dev/null +++ b/fnfx.init @@ -0,0 +1,74 @@ +#!/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