NETWORKING=yes FORWARD_IPV4="yes" HOSTNAME="localhost.localdomain" GATEWAY="128.171.80.70" GATEWAYDEV="" NISDOMAIN="cfht" # The defaults overriden by: # 1. Kernel command line arguments for network booting (see /proc/cmdline) # 2. Master /Config file for stand-alone hosts. # Check if command line arguments were give to the Kernel coming # from a bootp/dhcp server which override the hostname and IPs: # This depends a lot on the way the .bpb script passes arguments. # See also /etc/sysconfig/network-scripts/ifcfg-eth0 get_hostname_and_gateway() { if [ -f /proc/cmdline ]; then CMDLINE=`cat /proc/cmdline 2> /dev/null` for CMDOPT in $CMDLINE; do case $CMDOPT in ip=*) SAVE_IFS="$IFS" IFS="=" set $CMDOPT IPARGS=$2 IFS=":" set $IPARGS HOSTNAME=$5.cfht.hawaii.edu if [ "$3" != "" ] && [ "$3" != "0.0.0.0" ]; then GATEWAY=$3 fi IFS="$SAVE_IFS" ;; DHCP_GATEWAY=*) SAVE_IFS="$IFS" IFS="=" set $CMDOPT if [ "$2" != "" ]; then GATEWAY=$2; fi IFS="$SAVE_IFS" ;; esac done if [ "$HOSTNAME" = "localhost.localdomain" ]; then source /Config if ( grep -q "$HOSTNAME" /etc/hosts ); then : # OK... else echo 'warning: *** $HOSTNAME is not in /etc/hosts. Please add it. ***' fi fi fi } get_hostname_and_gateway