044b357a31
Approved-by: jordan
54 lines
1.8 KiB
Bash
54 lines
1.8 KiB
Bash
#!/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() {
|
|
swapfile="NO" # Set to name of swapfile if aux swapfile desired.
|
|
firewall="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"
|
|
}
|
|
|
|
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
|
|
hostname=default
|
|
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
|