summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/securelevel
blob: c3f3121ef47b499d17d5f206ee2ae2e079c0a2a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
#
# $NetBSD: securelevel,v 1.1 2000/08/21 23:31:24 lukem Exp $
#

# PROVIDE: securelevel
# REQUIRE: aftermountlkm ipnat mountd

. /etc/rc.subr

name="securelevel"
start_cmd="securelevel_start"
stop_cmd=":"

securelevel_start()
{
	#	if $securelevel is set, change it here, else if it is 0,
	#	change it to 1 here, before we start daemons or login services.
	#
	if [ -n "$securelevel" ]; then
		echo -n "Setting securelevel: "
		sysctl kern.securelevel=$securelevel
	else
		securelevel=`sysctl -n kern.securelevel`
		if [ x"$securelevel" = x0 ]; then
			echo -n "Setting securelevel: "
			sysctl kern.securelevel=1
		fi
 	fi
}

load_rc_config $name
run_rc_command "$1"
OpenPOWER on IntegriCloud