2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $NetBSD: securelevel,v 1.4 2002/03/22 04:34:00 thorpej Exp $
|
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: securelevel
|
2004-01-17 10:16:38 +00:00
|
|
|
# KEYWORD: FreeBSD
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="securelevel"
|
|
|
|
start_cmd="securelevel_start"
|
|
|
|
stop_cmd=":"
|
|
|
|
|
|
|
|
securelevel_start()
|
|
|
|
{
|
2003-04-24 08:27:29 +00:00
|
|
|
# Last chance to set sysctl variables that failed the first time.
|
|
|
|
#
|
|
|
|
/etc/rc.d/sysctl lastload
|
|
|
|
|
2004-01-17 10:59:43 +00:00
|
|
|
case ${kern_securelevel_enable} in
|
|
|
|
[Yy][Ee][Ss])
|
|
|
|
if [ ${kern_securelevel} -ge 0 ]; then
|
|
|
|
echo 'Raising kernel security level: '
|
|
|
|
${SYSCTL_W} kern.securelevel=${kern_securelevel}
|
2001-06-16 07:16:14 +00:00
|
|
|
fi
|
2002-06-13 22:14:37 +00:00
|
|
|
;;
|
|
|
|
esac
|
2001-06-16 07:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|