2007-07-01 12:01:29 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2007-10-07 09:30:56 +04:00
|
|
|
# $NetBSD: envsys,v 1.4 2007/10/07 05:30:56 xtraeme Exp $
|
2007-07-01 12:01:29 +04:00
|
|
|
#
|
2007-10-07 09:30:56 +04:00
|
|
|
|
2007-07-01 12:01:29 +04:00
|
|
|
# PROVIDE: envsys
|
|
|
|
# REQUIRE: LOGIN DAEMON
|
|
|
|
|
|
|
|
$_rc_subr_loaded . /etc/rc.subr
|
|
|
|
|
|
|
|
name="envsys"
|
|
|
|
rcvar=${name}
|
2007-10-07 08:19:06 +04:00
|
|
|
command="/usr/sbin/envstat"
|
2007-07-01 12:01:29 +04:00
|
|
|
required_files="/etc/envsys.conf"
|
2007-10-07 08:19:06 +04:00
|
|
|
start_cmd="do_start"
|
|
|
|
stop_cmd="do_stop"
|
2007-07-01 12:01:29 +04:00
|
|
|
|
2007-10-07 08:19:06 +04:00
|
|
|
do_start()
|
2007-07-01 12:01:29 +04:00
|
|
|
{
|
2007-10-07 08:19:06 +04:00
|
|
|
${command} -c ${required_files}
|
2007-10-07 09:30:56 +04:00
|
|
|
[ $? -eq 0 ] && echo "Setting new sensor properties."
|
2007-10-07 08:19:06 +04:00
|
|
|
}
|
2007-07-01 12:01:29 +04:00
|
|
|
|
2007-10-07 08:19:06 +04:00
|
|
|
do_stop()
|
|
|
|
{
|
|
|
|
${command} -S
|
2007-10-07 09:30:56 +04:00
|
|
|
[ $? -eq 0 ] && echo "Removing sensor properties."
|
2007-07-01 12:01:29 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config ${name}
|
|
|
|
run_rc_command "$1"
|