freebsd-dev/etc/rc.d/sysctl
Doug Barton e3c46a3332 Remove $NetBSD$ CVS tags. We no longer attempt to synch our rc.d files
with theirs, so this information doesn't need to be in the live file.
Having it in our CVS history is enough.
2007-12-08 07:20:23 +00:00

53 lines
796 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: sysctl
# REQUIRE: root
# BEFORE: DAEMON
. /etc/rc.subr
name="sysctl"
stop_cmd=":"
start_cmd="sysctl_start"
reload_cmd="sysctl_start"
lastload_cmd="sysctl_start last"
extra_commands="reload lastload"
sysctl_start()
{
#
# Read in /etc/sysctl.conf and set things accordingly
#
if [ -f /etc/sysctl.conf ]; then
while read var comments
do
case ${var} in
\#*|'')
;;
*)
mib=${var%=*}
val=${var#*=}
if current_value=`${SYSCTL} -n ${mib} 2>/dev/null`; then
case ${current_value} in
${val})
;;
*)
sysctl "${var}"
;;
esac
elif [ "$1" = "last" ]; then
warn "sysctl ${mib} does not exist."
fi
;;
esac
done < /etc/sysctl.conf
fi
}
load_rc_config $name
run_rc_command "$1"