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
|
2002-07-07 04:16:53 +00:00
|
|
|
# KEYWORD: FreeBSD NetBSD
|
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}"
|
|
|
|
|
2002-09-06 16:18:05 +00:00
|
|
|
case ${OSTYPE} in
|
2002-07-07 04:16:53 +00:00
|
|
|
FreeBSD)
|
|
|
|
start_precmd="apmd_prestart"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
apmd_prestart()
|
|
|
|
{
|
2002-10-12 10:31:31 +00:00
|
|
|
case `${SYSCTL_N} hw.machine_arch` in
|
|
|
|
i386)
|
2002-07-07 04:16:53 +00:00
|
|
|
# Don't start if apm is already running
|
|
|
|
/etc/rc.d/apm forcestatus > /dev/null && return 1
|
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"
|