2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: securelevel
|
2012-08-22 18:35:17 +00:00
|
|
|
# REQUIRE: adjkerntz ipfw ipfilter pf
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="securelevel"
|
2016-04-23 16:10:54 +00:00
|
|
|
desc="Securelevel configuration"
|
2004-01-17 11:11:18 +00:00
|
|
|
rcvar='kern_securelevel_enable'
|
2001-06-16 07:16:14 +00:00
|
|
|
start_cmd="securelevel_start"
|
|
|
|
stop_cmd=":"
|
|
|
|
|
2004-01-17 11:11:18 +00:00
|
|
|
# Last chance to set sysctl variables that failed the first time.
|
|
|
|
#
|
|
|
|
/etc/rc.d/sysctl lastload
|
|
|
|
|
2001-06-16 07:16:14 +00:00
|
|
|
securelevel_start()
|
|
|
|
{
|
2004-01-17 11:11:18 +00:00
|
|
|
if [ ${kern_securelevel} -ge 0 ]; then
|
|
|
|
echo 'Raising kernel security level: '
|
2011-03-30 01:19:00 +00:00
|
|
|
${SYSCTL} kern.securelevel=${kern_securelevel}
|
2004-01-17 11:11:18 +00:00
|
|
|
fi
|
2001-06-16 07:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|