da178c777f
capability of parsing both = and : formats). Submitted by: hrs (initial version, bugs are mine) MFC after: 3 months
36 lines
496 B
Bash
Executable File
36 lines
496 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: sysctl
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="sysctl"
|
|
command="/sbin/sysctl"
|
|
stop_cmd=":"
|
|
start_cmd="sysctl_start"
|
|
reload_cmd="sysctl_start"
|
|
lastload_cmd="sysctl_start last"
|
|
extra_commands="reload lastload"
|
|
|
|
sysctl_start()
|
|
{
|
|
case $1 in
|
|
last)
|
|
command_args="-i -f"
|
|
;;
|
|
*)
|
|
command_args="-f"
|
|
;;
|
|
esac
|
|
|
|
for _f in /etc/sysctl.conf /etc/sysctl.conf.local; do
|
|
[ -r ${_f} ] && ${command} ${command_args} ${_f} > /dev/null
|
|
done
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|