1#!/bin/sh
| 1#!/bin/sh
|
2# $FreeBSD: head/release/picobsd/floppy.tree/etc/rc.conf 57048 2000-02-08 14:20:54Z luigi $
| 2# $FreeBSD: head/release/picobsd/floppy.tree/etc/rc.conf 69416 2000-11-30 21:43:37Z luigi $
|
3# 4# rc.conf for picobsd. 5# $main_ether and $main_if are set from rc to the ethernet address and 6# name of the first ethernet interface, if available, so a simple 7# here-document below can be used for autoconfiguration. 8# Remaining parameters are set using a switch. 9 10rc_conf_set_defaults() {
| 3# 4# rc.conf for picobsd. 5# $main_ether and $main_if are set from rc to the ethernet address and 6# name of the first ethernet interface, if available, so a simple 7# here-document below can be used for autoconfiguration. 8# Remaining parameters are set using a switch. 9 10rc_conf_set_defaults() {
|
| 11syslogd_enable="NO" 12pccard_enable="NO"
|
11swapfile="NO" # Set to name of swapfile if aux swapfile desired.
| 13swapfile="NO" # Set to name of swapfile if aux swapfile desired.
|
12firewall="NO" # firewall type (see /etc/rc.firewall) or NO
| 14firewall_enable="NO" # firewall type (see /etc/rc.firewall) or NO
|
13tcp_extensions="NO" # Allow RFC1323 & RFC1644 extensions (or NO). 14ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. 15#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. 16### Network daemons options: ### 17sshd_enable="YES" # if present... 18inetd_enable="YES" # Run the network daemon dispatcher (or NO) 19inetd_flags="" # Optional flags to inetd 20snmpd_enable="NO" # Run the SNMP daemon (or NO) 21snmpd_flags="-C -c /etc/snmpd.conf" # Optional flags to snmpd 22### Network routing options: ### 23defaultrouter="NO" # Set to default gateway (or NO). 24static_routes="" # Set to static route list (or leave empty). 25gateway_enable="NO" # Set to YES if this host will be a gateway. 26arpproxy_all="" # replaces obsolete kernel option ARP_PROXYALL. 27mask="0xffffff00" 28} 29
| 15tcp_extensions="NO" # Allow RFC1323 & RFC1644 extensions (or NO). 16ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. 17#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. 18### Network daemons options: ### 19sshd_enable="YES" # if present... 20inetd_enable="YES" # Run the network daemon dispatcher (or NO) 21inetd_flags="" # Optional flags to inetd 22snmpd_enable="NO" # Run the SNMP daemon (or NO) 23snmpd_flags="-C -c /etc/snmpd.conf" # Optional flags to snmpd 24### Network routing options: ### 25defaultrouter="NO" # Set to default gateway (or NO). 26static_routes="" # Set to static route list (or leave empty). 27gateway_enable="NO" # Set to YES if this host will be a gateway. 28arpproxy_all="" # replaces obsolete kernel option ARP_PROXYALL. 29mask="0xffffff00" 30} 31
|
| 32# the following lets the user specify a name and ip for his system 33read_address() { 34 echo "Please enter a hostname and IP address for your system $main_ether" 35 read hostname the_ip 36 if [ "X$hostname" != "X" ] ; then 37 echo "# $main_ether $hostname" >> /etc/hosts 38 echo "$the_ip $hostname" >> /etc/hosts 39 else 40 hostname=default 41 fi 42} 43
|
30rc_conf_set_defaults 31 32hostname="" 33while read a b c ; do 34 if [ "$a" = "#ethertable" ] ; then 35 hostname="." 36 elif [ "X$hostname" = "X." -a "X$a" = "X#" -a "X$b" = "X$main_ether" ] 37 then 38 hostname=$c 39 break 40 fi 41done < /etc/hosts 42if [ "X$hostname" = "X" -o "X$hostname" = "X." ] ; then
| 44rc_conf_set_defaults 45 46hostname="" 47while read a b c ; do 48 if [ "$a" = "#ethertable" ] ; then 49 hostname="." 50 elif [ "X$hostname" = "X." -a "X$a" = "X#" -a "X$b" = "X$main_ether" ] 51 then 52 hostname=$c 53 break 54 fi 55done < /etc/hosts 56if [ "X$hostname" = "X" -o "X$hostname" = "X." ] ; then
|
43 hostname=default
| 57 if [ "X$main_ether" = "X" ] ; then 58 echo "No ethernets found, using localhost" 59 hostname=localhost 60 else 61 read_address 62 fi
|
44fi 45 46eval ifconfig_${main_if}=\" \$hostname netmask \$mask\" 47network_interfaces=`ifconfig -l` 48 49### Allow local configuration override at the very end here ## 50### can make use of a case statement to set per-host things. 51if [ -f /etc/rc.conf.local ]; then 52 . /etc/rc.conf.local 53fi
| 63fi 64 65eval ifconfig_${main_if}=\" \$hostname netmask \$mask\" 66network_interfaces=`ifconfig -l` 67 68### Allow local configuration override at the very end here ## 69### can make use of a case statement to set per-host things. 70if [ -f /etc/rc.conf.local ]; then 71 . /etc/rc.conf.local 72fi
|