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