1996-03-12 15:39:26 +00:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
1998-09-02 01:34:57 +00:00
|
|
|
# $Id:$
|
|
|
|
#
|
1997-11-20 22:31:11 +00:00
|
|
|
# pccard_ether interfacename [ifconfig option]
|
1996-03-12 15:39:26 +00:00
|
|
|
#
|
1997-11-20 22:31:11 +00:00
|
|
|
# example: pccard_ether ep0 -link0
|
1996-03-12 15:39:26 +00:00
|
|
|
#
|
|
|
|
|
1997-06-30 19:10:50 +00:00
|
|
|
# Suck in the /etc/rc.conf variables
|
|
|
|
if [ -f /etc/rc.conf ]; then
|
|
|
|
. /etc/rc.conf
|
1996-03-12 15:39:26 +00:00
|
|
|
fi
|
|
|
|
|
1996-04-24 00:04:10 +00:00
|
|
|
if [ "x$pccard_ifconfig" != "xNO" ] ; then
|
1996-03-12 15:39:26 +00:00
|
|
|
if [ "x$pccard_ifconfig" = "xDHCP" ] ; then
|
1997-12-16 02:25:36 +00:00
|
|
|
if [ -f /usr/local/sbin/dhclient ] ; then
|
|
|
|
if [ -s /var/run/dhclient.pid ] ; then
|
|
|
|
kill `cat /var/run/dhclient.pid`
|
|
|
|
rm /var/run/dhclient.pid
|
|
|
|
fi
|
|
|
|
/usr/local/sbin/dhclient
|
1998-08-14 06:31:58 +00:00
|
|
|
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 $*
|
1997-12-17 01:57:18 +00:00
|
|
|
else
|
|
|
|
echo "DHCP client software not available (isc-dhcp2)"
|
1997-12-16 02:25:36 +00:00
|
|
|
fi
|
1996-03-12 15:39:26 +00:00
|
|
|
else
|
|
|
|
interface=$1
|
|
|
|
shift
|
|
|
|
ifconfig $interface $pccard_ifconfig $*
|
|
|
|
fi
|
|
|
|
fi
|
1997-11-19 18:51:25 +00:00
|
|
|
|
|
|
|
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
|
1997-11-20 22:31:11 +00:00
|
|
|
arp -d -a
|
1997-11-19 18:51:25 +00:00
|
|
|
for i in ${static_routes}; do
|
|
|
|
eval route_args=\$route_${i}
|
|
|
|
route add ${route_args}
|
|
|
|
done
|
|
|
|
fi
|