rc.conf revision 57048
1123682Sache#!/bin/sh
2123682Sache# $FreeBSD: head/release/picobsd/floppy.tree/etc/rc.conf 57048 2000-02-08 14:20:54Z luigi $
3123682Sache#
4123682Sache# rc.conf for picobsd.
5123682Sache# $main_ether and $main_if are set from rc to the ethernet address and
6123682Sache# name of the first ethernet interface, if available, so a simple
7123682Sache# here-document below can be used for autoconfiguration.
8123682Sache# Remaining parameters are set using a switch.
9123682Sache
10123682Sacherc_conf_set_defaults() {
11123682Sacheswapfile="NO"		# Set to name of swapfile if aux swapfile desired.
12123682Sachefirewall="NO"			# firewall type (see /etc/rc.firewall) or NO
13123682Sachetcp_extensions="NO"		# Allow RFC1323 & RFC1644 extensions (or NO).
14123682Sacheifconfig_lo0="inet 127.0.0.1"	# default loopback device configuration.
15123682Sache#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
16123682Sache### Network daemons options: ###
17123682Sachesshd_enable="YES"		# if present...
18123682Sacheinetd_enable="YES"		# Run the network daemon dispatcher (or NO)
19123682Sacheinetd_flags=""			# Optional flags to inetd
20123682Sachesnmpd_enable="NO"		# Run the SNMP daemon (or NO)
21123682Sachesnmpd_flags="-C -c /etc/snmpd.conf"	# Optional flags to snmpd
22123682Sache### Network routing options: ###
23123682Sachedefaultrouter="NO"		# Set to default gateway (or NO).
24123682Sachestatic_routes=""		# Set to static route list (or leave empty).
25123682Sachegateway_enable="NO"		# Set to YES if this host will be a gateway.
26123682Sachearpproxy_all=""			# replaces obsolete kernel option ARP_PROXYALL.
27123682Sachemask="0xffffff00"
28123682Sache}
29123682Sache
30123682Sacherc_conf_set_defaults
31123682Sache
32123682Sachehostname=""
33123682Sachewhile read a b c ; do
34123682Sache    if [ "$a" = "#ethertable" ] ; then
35123682Sache        hostname="."
36123682Sache    elif [ "X$hostname" = "X." -a "X$a" = "X#" -a "X$b" = "X$main_ether" ]
37123682Sache    then
38123682Sache	hostname=$c
39123682Sache	break
40123682Sache    fi
41123682Sachedone < /etc/hosts
42123682Sacheif [ "X$hostname" = "X" -o "X$hostname" = "X." ] ; then
43123682Sache    hostname=default
44123682Sachefi
45123682Sache
46123682Sacheeval ifconfig_${main_if}=\" \$hostname netmask \$mask\"
47123682Sachenetwork_interfaces=`ifconfig -l`
48123682Sache
49123682Sache### Allow local configuration override at the very end here ##
50123682Sache### can make use of a case statement to set per-host things.
51123682Sacheif [ -f /etc/rc.conf.local ]; then
52123682Sache	. /etc/rc.conf.local
53123682Sachefi
54123682Sache