82387f41ed
in keeping the scripts under rc.d in sync with us. So, remove NetBSD specific stuff (which made our scripts more complicated than necessary). The NetBSD ident string will be left intact, both for history and also incase we wish to pull in future versions.
55 lines
874 B
Bash
55 lines
874 B
Bash
#!/bin/sh
|
|
#
|
|
# $NetBSD: sysctl,v 1.12 2002/04/29 12:10:23 lukem Exp $
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: sysctl
|
|
# REQUIRE: root
|
|
# BEFORE: DAEMON
|
|
# KEYWORD: FreeBSD
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="sysctl"
|
|
stop_cmd=":"
|
|
start_cmd="FreeBSD_start"
|
|
extra_commands="reload lastload"
|
|
reload_cmd="FreeBSD_start"
|
|
lastload_cmd="FreeBSD_start last"
|
|
|
|
FreeBSD_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"
|