summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/sysctl
blob: 6e968f706c5df47f276607936bba4a2d05e90cf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: sysctl

. /etc/rc.subr

name="sysctl"
command="/sbin/sysctl"
stop_cmd=":"
start_cmd="sysctl_start"
reload_cmd="sysctl_start last"
lastload_cmd="sysctl_start last"
extra_commands="reload lastload"

sysctl_start()
{
	case $1 in
	last)
		command_args="-f"
	;;
	*)
		command_args="-i -f"
	;;
	esac

	for _f in /etc/sysctl.conf /etc/sysctl.conf.local; do
		if [ -r ${_f} ]; then
			${command} ${command_args} ${_f} > /dev/null
		fi
	done
}

load_rc_config $name
run_rc_command "$1"
OpenPOWER on IntegriCloud