rc1 revision 91949
1#!/bin/sh
2# $FreeBSD: head/release/picobsd/floppy.tree/etc/rc1 91949 2002-03-09 18:27:02Z luigi $
3### rc1, next stage 'rc' for PicoBSD -- THIS IS NOT THE NORMAL /etc/rc 
4
5. /etc/rc.conf.defaults		# Load default procedures
6rc_conf_set_defaults		# Assign default values to variables.
7find_system_id			# Set $main_eth $main_if
8set_main_interface		# Set ${hostname} and ${ifconfig_${main_if}}
9set_all_interfaces		# Set ${ifconfig_${if}} for other interfaces.
10
11# Now process local configurations if present. ${hostname} should be set now,
12# so rc.conf[.local] can make use of a case statement to set per-host things.
13
14[ -f /etc/rc.conf ] && . /etc/rc.conf
15[ -f /etc/rc.conf.local ] && . /etc/rc.conf.local
16
17### Now use some variables to override files in /etc ###
18( IFS=''
19[ -n ${host_conf} ] && echo ${host_conf} > /etc/host.conf
20[ -n ${resolv_conf} ] && echo ${resolv_conf} > /etc/resolv.conf
21unset IFS
22)
23
24rm -f /var/run/*
25if [ "x$swapfile" != "xNO" -a -w "$swapfile" -a -b /dev/vn0b ]; then
26	echo "Adding $swapfile as additional swap."
27	vnconfig /dev/vn0b $swapfile && swapon /dev/vn0b
28else
29	echo "No swap partition available!"
30fi
31# configure serial devices
32[ -f /etc/rc.serial ] && . /etc/rc.serial
33
34# start up the initial network configuration.
35if [ -f /etc/rc.network ]; then
36	. /etc/rc.network
37	network_pass1
38fi
39mount -a -t nfs
40chmod 666 /dev/tty[pqrsPQRS]*
41# clean up left-over files
42(cd /var/run && { cp /dev/null utmp; chmod 644 utmp; })
43
44[ -n "$network_pass1_done" ] && network_pass2
45[ -n "$network_pass2_done" ] && network_pass3
46
47[ "${inetd_enable}" = "YES" -a -f /stand/inetd ] && \
48	{ echo "Starting inetd."; inetd ${inetd_flags} ; }
49
50[ "${sshd_enable}" = "YES" -a -f /stand/sshd ] && \
51	{ echo "Starting sshd..." ; sshd -f /etc/sshd_config ; }
52
53pwd_mkdb -p ./master.passwd
54dev_mkdb
55
56echo ''
57cat /etc/motd
58exit 0
59