]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - etc/rc.d/apm
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / etc / rc.d / apm
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: apm
7 # REQUIRE: DAEMON
8 # BEFORE:  LOGIN
9 # KEYWORD: nojail
10
11 . /etc/rc.subr
12
13 name="apm"
14 rcvar="apm_enable"
15 start_precmd="apm_precmd"
16 command="/usr/sbin/${name}"
17 start_cmd="${command} -e enable"
18 stop_cmd="${command} -e disable"
19 status_cmd="apm_status"
20
21 apm_precmd()
22 {
23         case `${SYSCTL_N} hw.machine_arch` in
24         i386)
25                 return 0
26                 ;;
27         esac
28         return 1
29 }
30
31 apm_status()
32 {
33         case `${command} -s` in
34         1)
35                 echo "APM is enabled."
36                 return 0
37                 ;;
38         0)
39                 echo "APM is disabled"
40                 ;;
41         esac
42         return 1
43 }
44
45 load_rc_config $name
46 run_rc_command "$1"