]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - libexec/rc/rc.d/apm
amd64: use register macros for gdb_cpu_getreg()
[FreeBSD/FreeBSD.git] / libexec / rc / rc.d / apm
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: apm
7 # REQUIRE: DAEMON
8 # BEFORE:  LOGIN
9 # KEYWORD: nojail
10
11 . /etc/rc.subr
12
13 name="apm"
14 desc="Advanced power management"
15 rcvar="apm_enable"
16 start_precmd="apm_precmd"
17 command="/usr/sbin/${name}"
18 start_cmd="${command} -e enable"
19 stop_cmd="${command} -e disable"
20 status_cmd="apm_status"
21
22 apm_precmd()
23 {
24         case `${SYSCTL_N} hw.machine_arch` in
25         i386)
26                 return 0
27                 ;;
28         esac
29         return 1
30 }
31
32 apm_status()
33 {
34         case `${command} -s` in
35         1)
36                 echo "APM is enabled."
37                 return 0
38                 ;;
39         0)
40                 echo "APM is disabled"
41                 ;;
42         esac
43         return 1
44 }
45
46 load_rc_config $name
47 run_rc_command "$1"