From 8bcc6dbeb644ff182706ec341bda4771e7166672 Mon Sep 17 00:00:00 2001 From: Preston Brown Date: Tue, 25 Sep 2001 18:48:06 +0000 Subject: need_hostname now returns true or false, doesn't set NEEDHOSTNAME. Some reformatting fixes. --- sysconfig/network-scripts/ifup | 5 +---- sysconfig/network-scripts/ifup-post | 7 +++++-- sysconfig/network-scripts/ifup-wireless | 5 ++++- sysconfig/network-scripts/network-functions | 8 +++++--- 4 files changed, 15 insertions(+), 10 deletions(-) (limited to 'sysconfig') diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index e4fcf05f..db8d3ca5 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -19,8 +19,6 @@ cd /etc/sysconfig/network-scripts [ -f ../network ] && . ../network [ -f ../networking/network ] && . ../networking/network -need_hostname - CONFIG=${1} [ -z "${CONFIG}" ] && { @@ -151,7 +149,7 @@ if [ -n "${DYNCONFIG}" ]; then PUMPARGS="-h ${DHCP_HOSTNAME}" DHCPCDARGS="-h ${DHCP_HOSTNAME}" fi - if [ -n "${NEEDHOSTNAME}" ]; then + if need_hostname; then PUMPARGS="${PUMPARGS} --lookup-hostname" DHCPCDARGS="${DHCPCDARGS} -H" fi @@ -242,7 +240,6 @@ else # set up default gateway if [ -n "${GATEWAY}" -a "`ipcalc --network ${GATEWAY} ${NETMASK} 2>/dev/null`" = "NETWORK=${NETWORK}" ]; then ip route add default via ${GATEWAY} - DEFGW=${GATEWAY} elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then ip route add default dev ${DEVICE} fi diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post index 10a6fa16..740c466b 100755 --- a/sysconfig/network-scripts/ifup-post +++ b/sysconfig/network-scripts/ifup-post @@ -3,7 +3,6 @@ cd /etc/sysconfig/network-scripts . network-functions -need_hostname CONFIG=$1 source_config @@ -99,7 +98,11 @@ if [ "$FIREWALL_MODS" != "no" -a -n "$FWACTIVE" ]; then fi # don't set hostname on ppp/slip connections -if [ "$2" = "boot" -a -n "$NEEDHOSTNAME" -a "${DEVICE}" != lo -a "${DEVICETYPE}" != "ppp" -a "${DEVICETYPE}" != "slip" ]; then +if [ "$2" = "boot" -a + need_hostname -a + "${DEVICE}" != lo -a + "${DEVICETYPE}" != "ppp" -a + "${DEVICETYPE}" != "slip" ]; then IPADDR=`LANG= LC_ALL= ifconfig ${DEVICE} | grep 'inet addr' | awk -F: '{ print $2 } ' | awk '{ print $1 }'` eval `/bin/ipcalc --silent --hostname ${IPADDR}` diff --git a/sysconfig/network-scripts/ifup-wireless b/sysconfig/network-scripts/ifup-wireless index 87676ca7..ace878f4 100755 --- a/sysconfig/network-scripts/ifup-wireless +++ b/sysconfig/network-scripts/ifup-wireless @@ -62,18 +62,21 @@ fi if [ -n "$FRAG" ] ; then iwconfig $DEVICE frag $FRAG fi + # More specific parameters passed directly to IWCONFIG if [ -n "$IWCONFIG" ] ; then iwconfig $DEVICE $IWCONFIG fi + if [ -n "$SPYIPS" ] ; then for IP in $SPYIPS; do - iwspy $DEVICE $IP + iwspy $DEVICE + $IP done fi if [ -n "$IWPRIV" ] ; then iwpriv $DEVICE $IWPRIV fi + # ESSID need to be last : most device re-perform the scanning/discovery # when this is set, and things like encryption keys are better be # defined if we want to discover the right set of APs/nodes. diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index 991b5370..2793fa08 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -100,9 +100,9 @@ need_hostname() { if [ "`hostname`" = "(none)" -o "`hostname`" = "localhost" -o \ "`hostname`" = "localhost.localdomain" ]; then - NEEDHOSTNAME=yes + return 0 else - unset NEEDHOSTNAME + return 1 fi } @@ -179,7 +179,9 @@ add_default_route () { . /etc/sysconfig/network find_gateway_dev - if [ "${GATEWAY}" != "" -a "${GATEWAY}" != "none" -a "${GATEWAYDEV}" != "" ] ; then + if [ "${GATEWAY}" != "" -a + "${GATEWAY}" != "none" -a + "${GATEWAYDEV}" != "" ] ; then if ! check_device_down $1; then if [ "$GATEWAY" = "0.0.0.0" ]; then /sbin/ip route add default dev ${GATEWAYDEV} -- cgit v1.2.1