]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/apmd
This commit was generated by cvs2svn to compensate for changes in r170242,
[FreeBSD/FreeBSD.git] / etc / rc.d / apmd
1 #!/bin/sh
2 #
3 # $NetBSD: apmd,v 1.5 2002/03/22 04:33:58 thorpej Exp $
4 # $FreeBSD$
5 #
6
7 # PROVIDE: apmd
8 # REQUIRE: DAEMON apm
9 # BEFORE:  LOGIN
10 # KEYWORD: nojail
11
12 . /etc/rc.subr
13
14 name="apmd"
15 rcvar=`set_rcvar`
16 command="/usr/sbin/${name}"
17 start_precmd="apmd_prestart"
18
19 apmd_prestart()
20 {
21         case `${SYSCTL_N} hw.machine_arch` in
22         i386)
23                 # Enable apm if it is not already enabled
24                 if ! checkyesno apm_enable  && \
25                     ! /etc/rc.d/apm forcestatus 1>/dev/null 2>&1
26                 then
27                         force_depend apm || return 1
28                 fi
29
30                 # Warn user about acpi apm compatibility support which
31                 # does not work with apmd.
32                 if [ ! -e /dev/apmctl ]; then
33                     warn "/dev/apmctl not found; kernel is missing apm(4)"
34                 fi
35                 ;;
36         *)
37                 return 1
38                 ;;
39         esac
40         return 0
41 }
42
43 load_rc_config $name
44 run_rc_command "$1"