wg.conf.5: Fix a typo (in-inline comments are *not* allowed)
[dragonfly.git] / etc / rc.d / bootconf
blob1b46e36abf2a6e6b9664df67d88adc42f5a5f665
1 #!/bin/sh
3 # $NetBSD: bootconf.sh,v 1.5 2002/03/25 03:22:10 wiz Exp $
4 # $FreeBSD: src/etc/rc.d/bootconf.sh,v 1.4 2002/10/12 10:31:31 schweikh Exp $
7 # PROVIDE: bootconf
8 # REQUIRE: root
9 # BEFORE: mountcritlocal
11 . /etc/rc.subr
13 bootconf_start()
15 # Refer to newbtconf(8) for more information
18 if [ ! -e /etc/etc.current ]; then
19 return 0
21 if [ -L /etc/etc.default ]; then
22 def=`ls -ld /etc/etc.default 2>&1`
23 default="${def##*-> etc.}"
24 else
25 default=current
27 if [ "$default" = "current" ]; then
28 def=`ls -ld /etc/etc.current 2>&1`
29 default="${def##*-> etc.}"
32 spc=""
33 for i in /etc/etc.*; do
34 name="${i##/etc/etc.}"
35 case $name in
36 current|default|\*)
37 continue
40 if [ "$name" = "$default" ]; then
41 echo -n "${spc}[${name}]"
42 else
43 echo -n "${spc}${name}"
45 spc=" "
47 esac
48 done
49 echo
51 master=$$
52 _DUMMY=/etc/passwd
53 conf=${_DUMMY}
54 while [ ! -d /etc/etc.$conf/. ]; do
55 trap "conf=$default; echo; echo Using default of $conf" ALRM
56 echo -n "Which configuration [$default] ? "
57 (sleep 30 && kill -ALRM $master) >/dev/null 2>&1 &
58 read conf
59 trap : ALRM
60 if [ -z $conf ]; then
61 conf=$default
63 if [ ! -d /etc/etc.$conf/. ]; then
64 conf=${_DUMMY}
66 done
68 case $conf in
69 current|default)
72 rm -f /etc/etc.current
73 ln -s /etc/etc.$conf /etc/etc.current
75 esac
77 if [ -f /etc/rc.conf ]; then
78 . /etc/rc.conf
82 case "$1" in
83 *start)
84 bootconf_start
86 esac
88 dummy_rc_command $1 XXX