diff options
author | obrien <obrien@FreeBSD.org> | 2001-06-16 07:16:14 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2001-06-16 07:16:14 +0000 |
commit | afad76ee76d3a58cf84a1bc6fb12c55552bc5563 (patch) | |
tree | fd0686de98f61bd8f248380d2e5aee4905a258bb /etc/rc.d/bootconf.sh | |
parent | 3cf81c35aeec9a68f04a9ff772f9d4eb26e3605b (diff) | |
download | FreeBSD-src-afad76ee76d3a58cf84a1bc6fb12c55552bc5563.zip FreeBSD-src-afad76ee76d3a58cf84a1bc6fb12c55552bc5563.tar.gz |
Import the NetBSD 1.5 RC system.
Note that `rc' and `rc.shutdown' could not be imported because we already
have files with those names.
Diffstat (limited to 'etc/rc.d/bootconf.sh')
-rwxr-xr-x | etc/rc.d/bootconf.sh | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/etc/rc.d/bootconf.sh b/etc/rc.d/bootconf.sh new file mode 100755 index 0000000..8f663ca --- /dev/null +++ b/etc/rc.d/bootconf.sh @@ -0,0 +1,69 @@ +#!/bin/sh +# +# $NetBSD: bootconf.sh,v 1.2 2000/08/21 23:34:45 lukem Exp $ +# + +# PROVIDE: bootconf +# REQUIRE: mountcritlocal + +bootconf_start() +{ + # Refer to newbtconf(8) for more information + # + + if [ ! -e /etc/etc.current ]; then + return 0 + fi + if [ -h /etc/etc.default ]; then + def=`ls -ld /etc/etc.default 2>&1` + default="${def##*-> etc.}" + else + default=current + fi + spc="" + for i in /etc/etc.* + do + name="${i##/etc/etc.}" + case $name in + current|default|\*) + continue + ;; + *) + if [ "$name" = "$default" ]; then + echo -n "${spc}[${name}]" + else + echo -n "${spc}${name}" + fi + spc=" " + ;; + esac + done + echo + master=$$ + _DUMMY=/etc/passwd + conf=${_DUMMY} + while [ ! -d /etc/etc.$conf/. ]; do + trap "conf=$default; echo; echo Using default of $conf" 14 + echo -n "Which configuration [$default] ? " + (sleep 30 && kill -ALRM $master) >/dev/null 2>&1 & + read conf + trap : 14 + if [ -z $conf ] ; then + conf=$default + fi + if [ ! -d /etc/etc.$conf/. ]; then + conf=${_DUMMY} + fi + done + rm -f /etc/etc.current + ln -s /etc/etc.$conf /etc/etc.current + if [ -f /etc/rc.conf ] ; then + . /etc/rc.conf + fi +} + +case "$1" in +*start) + bootconf_start + ;; +esac |