summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/apm
blob: 5633377b8d004825d850a3d19748fe3cd38dbefb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: apm
# REQUIRE: DAEMON
# BEFORE:  LOGIN
# KEYWORD: nojail

. /etc/rc.subr

name="apm"
rcvar="apm_enable"
start_precmd="apm_precmd"
command="/usr/sbin/${name}"
start_cmd="${command} -e enable"
stop_cmd="${command} -e disable"
status_cmd="apm_status"

apm_precmd()
{
	case `${SYSCTL_N} hw.machine_arch` in
	i386)
		return 0
		;;
	esac
	return 1
}

apm_status()
{
	case `${command} -s` in
	1)
		echo "APM is enabled."
		return 0
		;;
	0)
		echo "APM is disabled"
		;;
	esac
	return 1
}

load_rc_config $name
run_rc_command "$1"
OpenPOWER on IntegriCloud