xref: /freebsd/release/rc.local (revision a09af1b7fd95d9479954c5b8e96a126cad468424)
18cfdf36dSNathan Whitehorn#!/bin/sh
2*a09af1b7SJessica Clarke#
3*a09af1b7SJessica Clarke# SPDX-License-Identifier: BSD-2-Clause
4*a09af1b7SJessica Clarke#
5*a09af1b7SJessica Clarke# Copyright (c) 2022 Jessica Clarke <jrtc27@FreeBSD.org>
6*a09af1b7SJessica Clarke#
7*a09af1b7SJessica Clarke# Redistribution and use in source and binary forms, with or without
8*a09af1b7SJessica Clarke# modification, are permitted provided that the following conditions
9*a09af1b7SJessica Clarke# are met:
10*a09af1b7SJessica Clarke# 1. Redistributions of source code must retain the above copyright
11*a09af1b7SJessica Clarke#    notice, this list of conditions and the following disclaimer.
12*a09af1b7SJessica Clarke# 2. Redistributions in binary form must reproduce the above copyright
13*a09af1b7SJessica Clarke#    notice, this list of conditions and the following disclaimer in the
14*a09af1b7SJessica Clarke#    documentation and/or other materials provided with the distribution.
15*a09af1b7SJessica Clarke#
16*a09af1b7SJessica Clarke# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17*a09af1b7SJessica Clarke# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18*a09af1b7SJessica Clarke# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19*a09af1b7SJessica Clarke# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20*a09af1b7SJessica Clarke# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21*a09af1b7SJessica Clarke# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22*a09af1b7SJessica Clarke# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23*a09af1b7SJessica Clarke# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24*a09af1b7SJessica Clarke# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25*a09af1b7SJessica Clarke# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26*a09af1b7SJessica Clarke# SUCH DAMAGE.
27*a09af1b7SJessica Clarke#
28*a09af1b7SJessica Clarke
29*a09af1b7SJessica Clarkebsdinstall_multicons_disabled()
30*a09af1b7SJessica Clarke{
31*a09af1b7SJessica Clarke	local var value
32*a09af1b7SJessica Clarke
33*a09af1b7SJessica Clarke	var=bsdinstall.multicons_disable
34*a09af1b7SJessica Clarke	value=`kenv -q $var`
35*a09af1b7SJessica Clarke	case "${value:-NO}" in
36*a09af1b7SJessica Clarke	[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
37*a09af1b7SJessica Clarke		return 0
38*a09af1b7SJessica Clarke		;;
39*a09af1b7SJessica Clarke	[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
40*a09af1b7SJessica Clarke		return 1
41*a09af1b7SJessica Clarke		;;
42*a09af1b7SJessica Clarke	*)
43*a09af1b7SJessica Clarke		warn "$var is not set properly, ignoring"
44*a09af1b7SJessica Clarke		return 1
45*a09af1b7SJessica Clarke		;;
46*a09af1b7SJessica Clarke	esac
47*a09af1b7SJessica Clarke}
488cfdf36dSNathan Whitehorn
49013713e7SNathan Whitehorn# resolv.conf from DHCP ends up in here, so make sure the directory exists
50013713e7SNathan Whitehornmkdir /tmp/bsdinstall_etc
51013713e7SNathan Whitehorn
52*a09af1b7SJessica Clarkeif bsdinstall_multicons_disabled; then
53*a09af1b7SJessica Clarke	/usr/libexec/bsdinstall/startbsdinstall primary
54*a09af1b7SJessica Clarkeelse
55*a09af1b7SJessica Clarke	echo
56*a09af1b7SJessica Clarke	/usr/libexec/bsdinstall/runconsoles /usr/libexec/bsdinstall/startbsdinstall %
57*a09af1b7SJessica Clarkefi
58