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
|
1999-09-13 15:44:20 +00:00
|
|
|
#
|
|
|
|
if [ -r /etc/defaults/rc.conf ]; then
|
1999-02-10 18:08:16 +00:00
|
|
|
. /etc/defaults/rc.conf
|
1999-09-13 15:44:20 +00:00
|
|
|
elif [ -r /etc/rc.conf ]; then
|
1997-06-30 19:10:50 +00:00
|
|
|
. /etc/rc.conf
|
1996-03-12 15:39:26 +00:00
|
|
|
fi
|
|
|
|
|
2000-02-11 14:49:42 +00:00
|
|
|
interface=$1
|
|
|
|
shift
|
|
|
|
|
1999-09-13 15:44:20 +00:00
|
|
|
case ${pccard_ifconfig} in
|
|
|
|
[Nn][Oo] | '')
|
|
|
|
;;
|
|
|
|
[Dd][Hh][Cc][Pp])
|
|
|
|
if [ -r /sbin/dhclient ]; then
|
|
|
|
if [ -s /var/run/dhclient.pid ]; then
|
1997-12-16 02:25:36 +00:00
|
|
|
kill `cat /var/run/dhclient.pid`
|
|
|
|
rm /var/run/dhclient.pid
|
|
|
|
fi
|
2000-02-11 14:49:42 +00:00
|
|
|
/sbin/dhclient $interface
|
1999-09-13 15:44:20 +00:00
|
|
|
elif [ -r /usr/local/sbin/dhcpc ]; then
|
|
|
|
if [ -s /var/run/dhcpc.pid ]; then
|
|
|
|
kill `cat /var/run/dhcpc.pid`
|
|
|
|
rm /var/run/dhcpc.pid
|
|
|
|
fi
|
2000-02-11 14:49:42 +00:00
|
|
|
/usr/local/sbin/dhcpc $interface $*
|
1996-03-12 15:39:26 +00:00
|
|
|
else
|
1999-09-13 15:44:20 +00:00
|
|
|
echo "DHCP client software not available (isc-dhcp2)"
|
1996-03-12 15:39:26 +00:00
|
|
|
fi
|
1999-09-13 15:44:20 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
ifconfig ${interface} ${pccard_ifconfig} $*
|
|
|
|
;;
|
|
|
|
esac
|
1997-11-19 18:51:25 +00:00
|
|
|
|
1999-09-13 15:44:20 +00:00
|
|
|
case ${defaultrouter} in
|
|
|
|
[Nn][Oo] | '')
|
|
|
|
;;
|
|
|
|
*)
|
1997-11-19 18:51:25 +00:00
|
|
|
static_routes="default ${static_routes}"
|
|
|
|
route_default="default ${defaultrouter}"
|
1999-09-13 15:44:20 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
1997-11-19 18:51:25 +00:00
|
|
|
# Set up any static routes.
|
1999-09-13 15:44:20 +00:00
|
|
|
#
|
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
|