freebsd-skq/etc/netstart
sheldonh e9b1278038 Add to defaults/rc.conf a new function source_rc_confs which rc
scripts may use to source safely overrides in ${rc_conf_files}
files.

This protects users who insist on the bad practice of copying
/etc/defaults/rc.conf to /etc/rc.conf from a recursive loop
that exhausts available file descriptors.

Several people have expressed interest in breaking this function
out into its own shell script.  Anyone who wants to embark on
such an undertaking would do well to study the attributed PR.

PR:		17595
Reported by:	adrian
Submitted by:	Doug Barton <Doug@gorean.org>
2000-04-27 08:43:49 +00:00

30 lines
713 B
Bash
Executable File

#!/bin/sh -
#
# $FreeBSD$
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# This file is NOT called by any of the other scripts - it has been
# obsoleted by /etc/rc.network and is provided here only for user
# convenience (if you're sitting in single user mode and wish to start
# the network by hand, this script will do it for you).
#
# If there is a global system configuration file, suck it in.
if [ -f /etc/defaults/rc.conf ]; then
. /etc/defaults/rc.conf
source_rc_confs
elif [ -f /etc/rc.conf ]; then
. /etc/rc.conf
fi
if [ -f /etc/rc.network ]; then
. /etc/rc.network
else
echo "Sorry, I can't find /etc/rc.network - aborting."
exit 1
fi
echo 'Doing stage one network startup:'
network_pass1
exit 0