]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - etc/rc.d/apmd
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / etc / rc.d / apmd
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: apmd
7 # REQUIRE: DAEMON apm
8 # BEFORE:  LOGIN
9 # KEYWORD: nojail shutdown
10
11 . /etc/rc.subr
12
13 name="apmd"
14 rcvar="apmd_enable"
15 command="/usr/sbin/${name}"
16 start_precmd="apmd_prestart"
17
18 apmd_prestart()
19 {
20         case `${SYSCTL_N} hw.machine_arch` in
21         i386)
22                 force_depend apm || return 1
23
24                 # Warn user about acpi apm compatibility support which
25                 # does not work with apmd.
26                 if [ ! -e /dev/apmctl ]; then
27                         warn "/dev/apmctl not found; kernel is missing apm(4)"
28                 fi
29                 ;;
30         *)
31                 return 1
32                 ;;
33         esac
34 }
35
36 load_rc_config $name
37 run_rc_command "$1"