1996-03-12 15:39:26 +00:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
1999-08-27 23:37:10 +00:00
|
|
|
# $FreeBSD$
|
1998-09-02 01:34:57 +00:00
|
|
|
#
|
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
|
|
|
#
|
|
|
|
|
1999-02-10 18:08:16 +00:00
|
|
|
# Suck in the configuration variables
|
|
|
|
if [ -f /etc/defaults/rc.conf ]; then
|
|
|
|
. /etc/defaults/rc.conf
|
|
|
|
elif [ -f /etc/rc.conf ]; then
|
1997-06-30 19:10:50 +00:00
|
|
|
. /etc/rc.conf
|
1996-03-12 15:39:26 +00:00
|
|
|
fi
|
|
|
|
|
1999-08-25 16:01:45 +00:00
|
|
|
if [ "${pccard_ifconfig}" != "NO" ] ; then
|
|
|
|
if [ "${pccard_ifconfig}" = "DHCP" ] ; then
|
1999-02-22 02:55:18 +00:00
|
|
|
if [ -f /sbin/dhclient ] ; then
|
1997-12-16 02:25:36 +00:00
|
|
|
if [ -s /var/run/dhclient.pid ] ; then
|
|
|
|
kill `cat /var/run/dhclient.pid`
|
|
|
|
rm /var/run/dhclient.pid
|
|
|
|
fi
|
1999-02-22 02:55:18 +00:00
|
|
|
/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
|
1999-08-25 16:01:45 +00:00
|
|
|
ifconfig ${interface} ${pccard_ifconfig} $*
|
1996-03-12 15:39:26 +00:00
|
|
|
fi
|
|
|
|
fi
|
1997-11-19 18:51:25 +00:00
|
|
|
|
1999-08-25 16:01:45 +00:00
|
|
|
if [ "${defaultrouter}" != "NO" ] ; then
|
1997-11-19 18:51:25 +00:00
|
|
|
static_routes="default ${static_routes}"
|
|
|
|
route_default="default ${defaultrouter}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set up any static routes.
|
1999-08-25 16:01:45 +00:00
|
|
|
if [ -n "${static_routes}" ]; then
|
1997-11-19 18:51:25 +00:00
|
|
|
# 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
|