5 # pccard_ether interfacename [start|stop|restart]
7 # example: pccard_ether fxp0 start
14 start_precmd="checkauto"
15 start_cmd="pccard_ether_start"
16 stop_precmd="checkauto"
17 stop_cmd="pccard_ether_stop"
18 restart_precmd="checkauto"
19 restart_cmd="pccard_ether_restart"
20 startchildren_cmd="pccard_ether_startchildren"
21 stopchildren_cmd="pccard_ether_stopchildren"
22 extra_commands="startchildren stopchildren"
26 # Add default route into $static_routes
27 case ${defaultrouter} in
31 static_routes="default ${static_routes}"
32 route_default="default ${defaultrouter}"
36 # Add private route for this interface into $static_routes
37 eval ifx_routes=\$static_routes_${ifn}
38 if [ -n "${ifx_routes}" ]; then
39 static_routes="${ifx_routes} ${static_routes}"
42 # Set up any static routes if specified
43 if [ -n "${static_routes}" ]; then
44 for i in ${static_routes}; do
45 eval route_args=\$route_${i}
46 route add ${route_args}
53 # Delete static route if specified
54 eval ifx_routes=\$static_routes_${ifn}
55 if [ -n "${ifx_routes}" ]; then
56 for i in ${ifx_routes}; do
57 eval route_args=\$route_${i}
58 route delete ${route_args}
65 if [ -z "$rc_force" ]; then
66 # Ignore interfaces with the NOAUTO keyword
73 ifexists $ifn || exit 1
75 if [ -z "$rc_force" ]; then
76 for uif in `ifconfig -ul`; do
77 if [ "${uif}" = "${ifn}" ]; then
78 # Interface is already up, so ignore it.
84 /etc/rc.d/netif quietstart $ifn
86 # Do route configuration if needed.
87 # XXX: should probably do this by calling rc.d/routing.
88 if [ -n "`ifconfig_getargs $ifn`" ]; then
89 if ! dhcpif $ifn; then
94 # XXX: IPv6 setup should be done in some way.
99 if [ -n "`ifconfig_getargs $ifn`" ]; then
100 if ! dhcpif $ifn; then
105 /etc/rc.d/netif quietstop $ifn
108 ifexists $ifn && arp -d -i $ifn -a
111 pccard_ether_restart()
113 # Hand implemented because the default implementation runs
114 # the equivalent of "$0 start; $0 stop" and this script
115 # doesn't support that syntax
120 pccard_ether_startchildren()
122 for child in `get_if_var $ifn wlans_IF`; do
123 if ifexists $child; then
126 /etc/rc.d/netif quietstart $child
130 pccard_ether_stopchildren()
132 for child in `get_if_var $ifn wlans_IF`; do
133 /etc/rc.d/netif quietstop $child
145 load_rc_config pccard_ether
146 load_rc_config network