]> git.pld-linux.org Git - packages/fnfx.git/blob - fnfx.init
*** empty log message ***
[packages/fnfx.git] / fnfx.init
1 #!/bin/sh
2 #
3 # chkconfig: 2345 27 73
4 # description: apmiser is used for monitoring system usage when on batteries, \
5 #       scaling the CPU voltage down via tpctl when idle to save power.
6 # processname: apmiser
7
8 # We can't run without acpi:
9 [ -e /proc/acpi ] || exit
10
11 # If toshiba_acpi doesn't exist, try loading the module...
12 [ -e /proc/acpi/toshiba ] || /sbin/modprobe toshiba_acpi &>/dev/null
13
14 # Don't bother if /proc/acpi/toshiba still doesn't exist
15 [ -e /proc/acpi/toshiba ]|| exit
16
17 # Source function library.
18 . /etc/init.d/functions
19
20 RETVAL=0
21
22 start() {
23         gprintf "Starting up Toshiba function key daemon (fnfxd): "
24         daemon /usr/sbin/fnfxd
25         touch /var/lock/subsys/fnfxd
26         echo
27 }
28
29 stop() {
30         gprintf "Shutting down Toshiba function key daemon (fnfxd): "
31         killproc fnfxd
32         RETVAL=$?
33         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/fnfxd
34         echo
35 }
36
37 dostatus() {
38         status fnfxd
39         RETVAL=$?
40 }
41
42 restart() {
43         stop
44         start
45         RETVAL=$?
46 }
47
48 condrestart() {
49         [ -e /var/lock/subsys/fnfxd ] && restart || :
50 }
51
52 # See how we were called.
53 case "$1" in
54   start)
55         start
56         ;;
57   stop)
58         stop
59         ;;
60   status)
61         dostatus
62         ;;
63   restart|reload)
64         restart
65         ;;
66   condrestart)
67         condrestart
68         ;;
69   *)
70         gprintf "Usage: $0 {start|stop|status|restart|reload|condrestart}\n"
71         exit 1
72 esac
73
74 exit $RETVAL
This page took 0.068696 seconds and 3 git commands to generate.