Merge from vendor branch BINUTILS:
[dragonfly.git] / etc / rc.d / securelevel
1 #!/bin/sh
2 #
3 # $NetBSD: securelevel,v 1.4 2002/03/22 04:34:00 thorpej Exp $
4 # $FreeBSD: src/etc/rc.d/securelevel,v 1.6 2003/05/05 15:38:41 mtm Exp $
5 # $DragonFly: src/etc/rc.d/securelevel,v 1.5 2006/10/24 09:24:15 victor Exp $
6 #
7
8 # PROVIDE: securelevel
9
10 . /etc/rc.subr
11
12 name="securelevel"
13 start_cmd="securelevel_start"
14 stop_cmd=":"
15
16 securelevel_start()
17 {
18         # Last chance to set sysctl variables that failed the first time.
19         #
20         /etc/rc.d/sysctl lastload
21
22         case ${kern_securelevel} in
23         [0-3]*)
24                 if [ ${kern_securelevel} -ge 0 ]; then
25                         echo 'Raising kernel security level: '
26                         ${SYSCTL_W} kern.securelevel=${kern_securelevel}
27                 fi
28                 ;;
29         esac
30 }
31
32 load_rc_config $name
33 run_rc_command "$1"