3 # $FreeBSD: head/libexec/rc/pccard_ether 339413 2018-10-17 16:49:11Z bz $
5 # pccard_ether interfacename [start|stop|restart]
7 # example: pccard_ether fxp0 start
14 start_cmd
="pccard_ether_start"
15 stop_cmd
="pccard_ether_stop"
16 restart_cmd
="pccard_ether_restart"
17 startchildren_cmd
="pccard_ether_startchildren"
18 stopchildren_cmd
="pccard_ether_stopchildren"
19 extra_commands
="startchildren stopchildren"
23 # Add default route into $static_routes
24 case ${defaultrouter} in
28 static_routes
="default ${static_routes}"
29 route_default
="default ${defaultrouter}"
33 # Add private route for this interface into $static_routes
34 eval ifx_routes
=\
$static_routes_${ifn}
35 if [ -n "${ifx_routes}" ]; then
36 static_routes
="${ifx_routes} ${static_routes}"
39 # Set up any static routes if specified
40 if [ -n "${static_routes}" ]; then
41 for i
in ${static_routes}; do
42 eval route_args
=\
$route_${i}
43 route add
${route_args}
50 # Delete static route if specified
51 eval ifx_routes
=\
$static_routes_${ifn}
52 if [ -n "${ifx_routes}" ]; then
53 for i
in ${ifx_routes}; do
54 eval route_args
=\
$route_${i}
55 route delete
${route_args}
62 ifexists
$ifn ||
exit 1
64 if [ -z "$rc_force" ]; then
65 for uif
in `ifconfig -ul`; do
66 if [ "${uif}" = "${ifn}" ]; then
67 # Interface is already up, so ignore it.
73 /etc
/rc.d
/netif start
$ifn
75 # Do route configuration if needed.
76 # XXX: should probably do this by calling rc.d/routing.
77 if [ -n "`ifconfig_getargs $ifn`" ]; then
78 if ! dhcpif
$ifn; then
83 # XXX: IPv6 setup should be done in some way.
88 if [ -n "`ifconfig_getargs $ifn`" ]; then
89 if ! dhcpif
$ifn; then
94 /etc
/rc.d
/netif stop
$ifn
97 ifexists
$ifn && arp
-d -i $ifn -a
100 pccard_ether_restart
()
102 # Hand implemented because the default implementation runs
103 # the equivalent of "$0 start; $0 stop" and this script
104 # doesn't support that syntax
109 pccard_ether_startchildren
()
111 for child
in `get_if_var $ifn wlans_IF`; do
112 if ifexists
$child; then
115 /etc
/rc.d
/netif start
$child
119 pccard_ether_stopchildren
()
121 for child
in `get_if_var $ifn wlans_IF`; do
122 /etc
/rc.d
/netif stop
$child
134 load_rc_config pccard_ether
135 load_rc_config network