f291e05470
o Modify rc.d/apmd to make correct use of this information. Submitted by: Simon L. Nielsen <simon@nitro.dk> (with minor modifications)
47 lines
562 B
Bash
47 lines
562 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: apm
|
|
# REQUIRE: DAEMON
|
|
# BEFORE: LOGIN
|
|
# KEYWORD: FreeBSD
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="apm"
|
|
rcvar=`set_rcvar`
|
|
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"
|