summaryrefslogtreecommitdiffstats
path: root/release/picobsd/floppy.tree/etc/rc.conf
blob: d597aa80f0ad84862aa7d8a2894635c64158667b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
# $FreeBSD$
#
# rc.conf for picobsd.
# $main_ether and $main_if are set from rc to the ethernet address and
# name of the first ethernet interface, if available, so a simple
# here-document below can be used for autoconfiguration.
# Remaining parameters are set using a switch.

rc_conf_set_defaults() {
syslogd_enable="NO"
pccard_enable="NO"
swapfile="NO"		# Set to name of swapfile if aux swapfile desired.
firewall_enable="NO"		# firewall type (see /etc/rc.firewall) or NO
tcp_extensions="NO"		# Allow RFC1323 & RFC1644 extensions (or NO).
ifconfig_lo0="inet 127.0.0.1"	# default loopback device configuration.
#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
### Network daemons options: ###
sshd_enable="YES"		# if present...
inetd_enable="YES"		# Run the network daemon dispatcher (or NO)
inetd_flags=""			# Optional flags to inetd
snmpd_enable="NO"		# Run the SNMP daemon (or NO)
snmpd_flags="-C -c /etc/snmpd.conf"	# Optional flags to snmpd
### Network routing options: ###
defaultrouter="NO"		# Set to default gateway (or NO).
static_routes=""		# Set to static route list (or leave empty).
gateway_enable="NO"		# Set to YES if this host will be a gateway.
arpproxy_all=""			# replaces obsolete kernel option ARP_PROXYALL.
mask="0xffffff00"
}

# the following lets the user specify a name and ip for his system
read_address() {
    echo "Please enter a hostname and IP address for your system $main_ether"
    read hostname the_ip
    if [ "X$hostname" != "X" ] ; then
	echo "# $main_ether $hostname" >> /etc/hosts
	echo "$the_ip $hostname" >> /etc/hosts
    else
	hostname=default
    fi
}

rc_conf_set_defaults

hostname=""
while read a b c ; do
    if [ "$a" = "#ethertable" ] ; then
        hostname="."
    elif [ "X$hostname" = "X." -a "X$a" = "X#" -a "X$b" = "X$main_ether" ]
    then
	hostname=$c
	break
    fi
done < /etc/hosts
if [ "X$hostname" = "X" -o "X$hostname" = "X." ] ; then
    if [ "X$main_ether" = "X" ] ; then
	echo "No ethernets found, using localhost"
	hostname=localhost
    else
	read_address
    fi
fi

eval ifconfig_${main_if}=\" \$hostname netmask \$mask\"
network_interfaces=`ifconfig -l`

### Allow local configuration override at the very end here ##
### can make use of a case statement to set per-host things.
if [ -f /etc/rc.conf.local ]; then
	. /etc/rc.conf.local
fi
OpenPOWER on IntegriCloud