1999-03-28 20:36:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
1999-08-27 23:37:10 +00:00
|
|
|
# $FreeBSD$
|
2000-10-08 19:20:36 +00:00
|
|
|
#
|
|
|
|
|
2002-07-18 05:00:17 +00:00
|
|
|
# PROVIDE: sysctl
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="sysctl"
|
2012-12-13 23:32:47 +00:00
|
|
|
command="/sbin/sysctl"
|
2002-07-18 05:00:17 +00:00
|
|
|
stop_cmd=":"
|
2004-01-17 11:15:04 +00:00
|
|
|
start_cmd="sysctl_start"
|
2013-03-22 20:12:25 +00:00
|
|
|
reload_cmd="sysctl_start last"
|
2004-01-17 11:15:04 +00:00
|
|
|
lastload_cmd="sysctl_start last"
|
2004-01-17 10:59:43 +00:00
|
|
|
extra_commands="reload lastload"
|
2002-07-18 05:00:17 +00:00
|
|
|
|
2008-07-31 21:57:35 +00:00
|
|
|
sysctl_start()
|
|
|
|
{
|
2012-12-13 23:32:47 +00:00
|
|
|
case $1 in
|
|
|
|
last)
|
2013-03-22 20:12:25 +00:00
|
|
|
command_args="-f"
|
2012-12-13 23:32:47 +00:00
|
|
|
;;
|
|
|
|
*)
|
2013-03-22 20:12:25 +00:00
|
|
|
command_args="-i -f"
|
2012-12-13 23:32:47 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
for _f in /etc/sysctl.conf /etc/sysctl.conf.local; do
|
|
|
|
[ -r ${_f} ] && ${command} ${command_args} ${_f} > /dev/null
|
|
|
|
done
|
2008-07-31 21:57:35 +00:00
|
|
|
}
|
|
|
|
|
2002-07-18 05:00:17 +00:00
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|