2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $NetBSD: apmd,v 1.5 2002/03/22 04:33:58 thorpej Exp $
|
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: apmd
|
2002-07-07 04:16:53 +00:00
|
|
|
# REQUIRE: DAEMON apm
|
2002-06-13 22:14:37 +00:00
|
|
|
# BEFORE: LOGIN
|
2004-01-17 10:16:38 +00:00
|
|
|
# KEYWORD: FreeBSD
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="apmd"
|
2002-07-07 04:16:53 +00:00
|
|
|
rcvar=`set_rcvar`
|
2001-06-16 07:16:14 +00:00
|
|
|
command="/usr/sbin/${name}"
|
2004-01-17 11:25:16 +00:00
|
|
|
start_precmd="apmd_prestart"
|
2002-07-07 04:16:53 +00:00
|
|
|
|
|
|
|
apmd_prestart()
|
|
|
|
{
|
2002-10-12 10:31:31 +00:00
|
|
|
case `${SYSCTL_N} hw.machine_arch` in
|
2003-05-06 00:09:51 +00:00
|
|
|
i386)
|
2003-06-09 17:44:30 +00:00
|
|
|
# Enable apm if it is not already enabled
|
|
|
|
if ! checkyesno apm_enable && \
|
|
|
|
! /etc/rc.d/apm forcestatus 1>/dev/null 2>&1
|
|
|
|
then
|
|
|
|
force_depend apm || return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Warn user about acpi apm compatibility support which
|
|
|
|
# does not work with apmd.
|
|
|
|
if [ ! -e /dev/apmctl ]; then
|
|
|
|
warn "/dev/apmctl not found; kernel is missing apm(4)"
|
|
|
|
fi
|
2002-10-12 10:31:31 +00:00
|
|
|
;;
|
2002-07-07 04:16:53 +00:00
|
|
|
*)
|
|
|
|
return 1
|
|
|
|
;;
|
2002-10-12 10:31:31 +00:00
|
|
|
esac
|
2002-07-07 04:16:53 +00:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2001-06-16 07:16:14 +00:00
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|