kernel/ecc: Remove unneeded MFILES line in the Makefile.
[dragonfly.git] / etc / rc.d / apmd
blob0d345874e2cfa2e09e38ae1fd99731dc400dd6a3
1 #!/bin/sh
3 # $NetBSD: apmd,v 1.5 2002/03/22 04:33:58 thorpej Exp $
4 # $FreeBSD: src/etc/rc.d/apmd,v 1.8 2003/06/09 17:44:30 mtm Exp $
5 # $DragonFly: src/etc/rc.d/apmd,v 1.3 2005/11/19 21:47:32 swildner Exp $
8 # PROVIDE: apmd
9 # REQUIRE: DAEMON apm
10 # BEFORE: LOGIN
12 . /etc/rc.subr
14 name="apmd"
15 rcvar=`set_rcvar`
16 command="/usr/sbin/${name}"
17 start_precmd="apmd_prestart"
18 apmd_prestart()
20 case `${SYSCTL_N} hw.machine_arch` in
21 i386)
22 # Enable apm if it is not already enabled
23 if ! checkyesno apm_enable && \
24 ! /etc/rc.d/apm forcestatus 1>/dev/null 2>&1
25 then
26 force_depend apm || return 1
29 # Warn user about acpi apm compatibility support which
30 # does not work with apmd.
31 if [ ! -e /dev/apmctl ]; then
32 warn "/dev/apmctl not found; kernel is missing apm(4)"
36 return 1
38 esac
39 return 0
42 load_rc_config $name
43 run_rc_command "$1"