2002-07-07 04:16:53 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: apm
|
|
|
|
# REQUIRE: DAEMON
|
|
|
|
# BEFORE: LOGIN
|
2004-10-07 13:55:26 +00:00
|
|
|
# KEYWORD: nojail
|
2002-07-07 04:16:53 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="apm"
|
|
|
|
rcvar=`set_rcvar`
|
|
|
|
start_precmd="apm_precmd"
|
|
|
|
command="/usr/sbin/${name}"
|
2003-06-09 17:44:30 +00:00
|
|
|
start_cmd="${command} -e enable"
|
|
|
|
stop_cmd="${command} -e disable"
|
|
|
|
status_cmd="apm_status"
|
2002-07-07 04:16:53 +00:00
|
|
|
|
|
|
|
apm_precmd()
|
|
|
|
{
|
|
|
|
case `${SYSCTL_N} hw.machine_arch` in
|
2003-05-05 23:55:43 +00:00
|
|
|
i386)
|
2002-07-07 04:16:53 +00:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2003-06-09 17:44:30 +00:00
|
|
|
apm_status()
|
|
|
|
{
|
|
|
|
case `${command} -s` in
|
|
|
|
1)
|
|
|
|
echo "APM is enabled."
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
0)
|
|
|
|
echo "APM is disabled"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2002-07-07 04:16:53 +00:00
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|