mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-23 11:18:54 +00:00
56 lines
1.3 KiB
Bash
Executable File
56 lines
1.3 KiB
Bash
Executable File
#!/bin/sh -
|
|
#
|
|
# $Id: pccard_ether,v 1.10 1999/02/10 18:08:16 jkh 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
|
|
elif [ -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
|