5 # pccard_ether interfacename [start|stop] [ifconfig option]
7 # example: pccard_ether ep0 start -link0
11 if [ -s /var/run/dhclient.${interface}.pid ]; then
12 pidfile="/var/run/dhclient.${interface}.pid"
13 elif [ -s /var/run/dhcpc.${interface}.pid ]; then
14 pidfile="/var/run/dhcpc.${interface}.pid"
24 if [ -x "${dhcp_program}" ]; then
25 if [ `basename ${dhcp_program}` = "dhclient" ]; then
26 pidfile="/var/run/dhclient.${interface}.pid"
27 dhcp_flags="${dhcp_flags} -pf ${pidfile}"
29 ${dhcp_program} ${dhcp_flags} ${interface}
31 echo "${dhcp_program}: DHCP client software not available"
35 # Suck in the configuration variables
37 if [ -r /etc/defaults/rc.conf ]; then
38 . /etc/defaults/rc.conf
40 elif [ -r /etc/rc.conf ]; then
49 case ${pccard_ether_delay} in
53 sleep ${pccard_ether_delay}
55 *) # Default until it has had a chance to make it to /etc/defaults/rc.conf
60 case ${pccard_ifconfig} in
62 expr "${removable_interfaces}" : ".*${interface}" > /dev/null || exit 0
66 eval ifconfig_${interface}=\${pccard_ifconfig}
71 [Ss][Tt][Aa][Rr][Tt] | '')
72 if [ -r /etc/start_if.${interface} ]; then
73 . /etc/start_if.${interface}
76 eval ifconfig_args=\$ifconfig_${interface}
77 case ${ifconfig_args} in
81 # Start up the DHCP client program
85 # Do the primary ifconfig if specified
86 ifconfig ${interface} ${ifconfig_args} $*
88 # Check to see if aliases need to be added
92 eval ifx_args=\$ifconfig_${interface}_alias${alias}
93 if [ -n "${ifx_args}" ]; then
94 ifconfig ${interface} ${ifx_args} alias
95 alias=`expr ${alias} + 1`
101 # Do ipx address if specified
102 eval ifx_args=\$ifconfig_${interface}_ipx
103 if [ -n "${ifx_args}" ]; then
104 ifconfig ${interface} ${ifx_args}
107 # Add default route into $static_routes
108 case ${defaultrouter} in
112 static_routes="default ${static_routes}"
113 route_default="default ${defaultrouter}"
117 # Add private route for this interface into $static_routes
118 eval ifx_routes=\$static_routes_${interface}
119 if [ -n "${ifx_routes}" ]; then
120 static_routes="${ifx_routes} ${static_routes}"
123 # Set up any static routes if specified
124 if [ -n "${static_routes}" ]; then
125 for i in ${static_routes}; do
126 eval route_args=\$route_${i}
127 route add ${route_args}
134 case ${ipv6_enable} in
136 if [ -r /etc/rc.network6 ]; then
138 network6_interface_setup ${interface}
145 if [ -r /etc/stop_if.${interface} ]; then
146 . /etc/stop_if.${interface}
149 eval ifconfig_args=\$ifconfig_${interface}
150 case ${ifconfig_args} in
154 # Stop the DHCP client for this interface
158 # Delelte static route if specified
159 eval ifx_routes=\$static_routes_${interface}
160 if [ -n "${ifx_routes}" ]; then
161 for i in ${ifx_routes}; do
162 eval route_args=\$route_${i}
163 route delete ${route_args}
167 # Delete aliases if exist
171 eval ifx_args=\$ifconfig_${interface}_alias${alias}
172 if [ -n "${ifx_args}" ]; then
173 ifconfig ${interface} ${ifx_args} alias delete
174 alias=`expr ${alias} + 1`
182 # Remove the network interface and cleaning ARP table
183 ifconfig ${interface} delete
186 # Clean the routing table
187 case ${removable_route_flush} in
191 # flush beforehand, just in case....