4814d31422
of selected files (at the moment /etc/host.conf and /etc/resolv.conf) from /etc/rc.conf , so the number of places to customize is reduced.
59 lines
1.7 KiB
Bash
59 lines
1.7 KiB
Bash
#!/bin/sh
|
|
# $FreeBSD$
|
|
### rc1, next stage 'rc' for PicoBSD -- THIS IS NOT THE NORMAL /etc/rc
|
|
|
|
. /etc/rc.conf.defaults # Load default procedures
|
|
rc_conf_set_defaults # Assign default values to variables.
|
|
find_system_id # Set $main_eth $main_if
|
|
set_main_interface # Set ${hostname} and ${ifconfig_${main_if}}
|
|
set_all_interfaces # Set ${ifconfig_${if}} for other interfaces.
|
|
|
|
# Now process local configurations if present. ${hostname} should be set now,
|
|
# so rc.conf[.local] can make use of a case statement to set per-host things.
|
|
|
|
[ -f /etc/rc.conf ] && . /etc/rc.conf
|
|
[ -f /etc/rc.conf.local ] && . /etc/rc.conf.local
|
|
|
|
### Now use some variables to override files in /etc ###
|
|
( IFS=''
|
|
[ -n ${host_conf} ] && echo ${host_conf} > /etc/host.conf
|
|
[ -n ${resolv_conf} ] && echo ${resolv_conf} > /etc/resolv.conf
|
|
unset IFS
|
|
)
|
|
|
|
rm -f /var/run/*
|
|
if [ "x$swapfile" != "xNO" -a -w "$swapfile" -a -b /dev/vn0b ]; then
|
|
echo "Adding $swapfile as additional swap."
|
|
vnconfig /dev/vn0b $swapfile && swapon /dev/vn0b
|
|
else
|
|
echo "No swap partition available!"
|
|
fi
|
|
# configure serial devices
|
|
[ -f /etc/rc.serial ] && . /etc/rc.serial
|
|
|
|
# start up the initial network configuration.
|
|
if [ -f /etc/rc.network ]; then
|
|
. /etc/rc.network
|
|
network_pass1
|
|
fi
|
|
mount -a -t nfs
|
|
chmod 666 /dev/tty[pqrsPQRS]*
|
|
# clean up left-over files
|
|
(cd /var/run && { cp /dev/null utmp; chmod 644 utmp; })
|
|
|
|
[ -n "$network_pass1_done" ] && network_pass2
|
|
[ -n "$network_pass2_done" ] && network_pass3
|
|
|
|
[ "${inetd_enable}" = "YES" -a -f /stand/inetd ] && \
|
|
{ echo "Starting inetd."; inetd ${inetd_flags} ; }
|
|
|
|
[ "${sshd_enable}" = "YES" -a -f /stand/sshd ] && \
|
|
{ echo "Starting sshd..." ; sshd -f /etc/sshd_config ; }
|
|
|
|
pwd_mkdb -p ./master.passwd
|
|
dev_mkdb
|
|
|
|
echo ''
|
|
cat /etc/motd
|
|
exit 0
|