54 lines
1.1 KiB
Bash
Executable File
54 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $NetBSD: sysctl,v 1.4 2000/04/15 21:14:51 tsarna Exp $
|
|
#
|
|
|
|
# PROVIDE: sysctl
|
|
# REQUIRE: root ipnat
|
|
|
|
. /etc/rc.subr
|
|
. /etc/rc.conf
|
|
|
|
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
|
|
sysctl -w kern.defcorename=$defcorename
|
|
__EOF__
|
|
fi
|
|
|
|
if [ "X$nfsiod_flags" != "X" ]; then
|
|
cat <<__EOF__
|
|
*** WARNING: /etc/rc.conf \$nfsiod_flags setting is obsolete. Please
|
|
*** set vfs.nfs.iothreads in /etc/sysctl.conf if using NFS client.
|
|
__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
|
|
}
|
|
|
|
run_rc_command "$1"
|