NetBSD/etc/rc.d/envsys

32 lines
508 B
Bash
Executable File

#!/bin/sh
#
# $NetBSD: envsys,v 1.5 2021/11/26 12:51:24 sborrill 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"