55 lines
1.2 KiB
Bash
Executable File
55 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $NetBSD: sysctl,v 1.8 2000/06/13 16:29:55 itojun Exp $
|
|
#
|
|
|
|
# PROVIDE: sysctl
|
|
# REQUIRE: root ipnat ipsec
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="sysctl"
|
|
start_cmd="sysctl_start"
|
|
stop_cmd=":"
|
|
|
|
sysctl_start()
|
|
{
|
|
if [ -n "$defcorename" ]; then
|
|
cat <<__EOF__
|
|
*** WARNING: /etc/rc.conf \$defcorename setting is obsolete. Please
|
|
*** set kern.defcorename in /etc/sysctl.conf
|
|
__EOF__
|
|
sysctl -w kern.defcorename=$defcorename
|
|
fi
|
|
|
|
if [ -n "$nfsiod_flags" ]; then
|
|
cat <<__EOF__
|
|
*** WARNING: /etc/rc.conf \$nfsiod_flags setting is obsolete. Please
|
|
*** remove it. If it was set to other than the default of "-n 4", then
|
|
*** set vfs.nfs.iothreads in /etc/sysctl.conf
|
|
__EOF__
|
|
fi
|
|
|
|
# if $securelevel is set, change it here, else if it is 0,
|
|
# change it to 1 here, before we start login services.
|
|
#
|
|
if [ -n "$securelevel" ]; then
|
|
echo -n "Setting securelevel: "
|
|
sysctl -w kern.securelevel=$securelevel
|
|
else
|
|
securelevel=`sysctl -n kern.securelevel`
|
|
if [ x"$securelevel" = x0 ]; then
|
|
echo -n "Setting securelevel: "
|
|
sysctl -w kern.securelevel=1
|
|
fi
|
|
fi
|
|
|
|
if [ -r /etc/sysctl.conf ]; then
|
|
echo "Setting sysctl variables:"
|
|
sysctl -f /etc/sysctl.conf
|
|
fi
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|