3 # $NetBSD: bootconf.sh,v 1.12 2009/09/11 18:17:43 apb Exp $
7 # REQUIRE: mountcritlocal
10 $_rc_subr_loaded .
/etc
/rc.subr
13 start_cmd
="bootconf_start"
18 # Refer to newbtconf(8) for more information
21 if [ ! -e /etc
/etc.current
]; then
24 if [ -h /etc
/etc.default
]; then
25 def
=$
(ls -ld /etc
/etc.default
2>&1)
26 default
="${def##*-> *etc.}"
30 if [ "$default" = "current" ]; then
31 def
=$
(ls -ld /etc
/etc.current
2>&1)
32 default
="${def##*-> *etc.}"
36 for i
in /etc
/etc.
*; do
37 name
="${i##/etc/etc.}"
43 if [ "$name" = "$default" ]; then
44 echo -n "${spc}[${name}]"
46 echo -n "${spc}${name}"
56 while [ ! -d /etc
/etc.
$conf/.
]; do
57 trap "conf=$default; echo; echo Using default of $default" ALRM
58 echo -n "Which configuration [$default] ? "
59 (sleep 30 && kill -ALRM $master) >/dev
/null
2>&1 &
62 if [ -z $conf ] ; then
65 if [ ! -d /etc
/etc.
$conf/.
]; then
70 print_rc_metadata
"note:Using configuration \"${conf}\""
76 rm -f /etc
/etc.current
77 ln -s etc.
$conf /etc
/etc.current
81 if [ -f /etc
/rc.conf
] ; then