NetBSD/etc/rc.d/envsys

32 lines
509 B
Bash
Executable File

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