Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jun 1999 03:00:12 -0600 (MDT)
From:      Kenneth Ingham <ingham@socrates.i-pi.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   conf/12361: /etc/pccard_ether does not look at /etc/rc.conf
Message-ID:  <199906230900.DAA00496@socrates.i-pi.com>

next in thread | raw e-mail | index | archive | help

>Number:         12361
>Category:       conf
>Synopsis:       /etc/pccard_ether does not look at /etc/rc.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 23 08:10:00 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Kenneth Ingham
>Release:        FreeBSD 3.2-RELEASE i386
>Organization:
Kenneth Ingham Consulting
>Environment:

	straight from the CD

>Description:

	/etc/pccard_ether only checks /etc/rc.conf if
	/etc/defaults/rc.conf does not exist.  It should check both.
	Fixed code is below.  Sorry for not sending a diff, but I fixed
	it then thought about sending in the pr.  The fix is changing
	from an elsif to a separate if for /etc/rc.conf.

>How-To-Repeat:

	Use pccardd with an ethernet card.

>Fix:
	
#!/bin/sh -
#
#	$Id: pccard_ether,v 1.9.2.2 1999/02/22 02:56:08 steve Exp $
#
# pccard_ether interfacename [ifconfig option]
#
# example: pccard_ether ep0 -link0
#

# Suck in the configuration variables
if [ -f /etc/defaults/rc.conf ]; then
	. /etc/defaults/rc.conf
fi
if [ -f /etc/rc.conf ]; then
	. /etc/rc.conf
fi

if [ "x$pccard_ifconfig" != "xNO" ] ; then
	if [ "x$pccard_ifconfig" = "xDHCP" ] ; then
		if [ -f /sbin/dhclient ] ; then
		    if [ -s /var/run/dhclient.pid ] ; then
			kill `cat /var/run/dhclient.pid`
			rm /var/run/dhclient.pid
		    fi
		    /sbin/dhclient
		elif [ -f /usr/local/sbin/dhcpc ] ; then
		    if [ -s /var/run/dhcpc.pid ] ; then
		        kill `cat /var/run/dhcpc.pid`
		        rm /var/run/dhcpc.pid
		    fi
		    /usr/local/sbin/dhcpc $* 
		else
		    echo "DHCP client software not available (isc-dhcp2)"
		fi
	else
		interface=$1
		shift
		ifconfig $interface $pccard_ifconfig $*
	fi
fi

if [ "x$defaultrouter" != "xNO" ] ; then
	static_routes="default ${static_routes}"
	route_default="default ${defaultrouter}"
fi
    
# Set up any static routes.
if [ "x${static_routes}" != "x" ]; then
	# flush beforehand, just in case....
        route -n flush
	arp -d -a
	for i in ${static_routes}; do
		eval route_args=\$route_${i}
		route add ${route_args}
	done
fi


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906230900.DAA00496>