freebsd-dev/sbin/init/rc.d/apm
Brad Davis 1135e97b7c Move rc startup scripts from etc/ to sbin/init/
This keeps most startup scripts as CONFS per discussion on src-committers from
back during BSDCan.

Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16466
2018-07-28 20:36:23 +00:00

48 lines
595 B
Bash
Executable File

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: apm
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: nojail
. /etc/rc.subr
name="apm"
desc="Advanced power management"
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"