Add tip(1)'s emulation of cu(1) to tip's manual page.
[dragonfly.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: 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.2 2004/01/27 00:55:43 rob Exp $
6 #
7
8 # PROVIDE: apmd
9 # REQUIRE: DAEMON apm
10 # BEFORE:  LOGIN
11 # KEYWORD: DragonFly
12
13 . /etc/rc.subr
14
15 name="apmd"
16 rcvar=`set_rcvar`
17 command="/usr/sbin/${name}"
18 start_precmd="apmd_prestart"
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"