Deleted Added
full compact
routing (179079) routing (179566)
1#!/bin/sh
2#
3# Configure routing and miscellaneous network tunables
4#
1#!/bin/sh
2#
3# Configure routing and miscellaneous network tunables
4#
5# $FreeBSD: head/etc/rc.d/routing 179079 2008-05-18 02:57:54Z brooks $
5# $FreeBSD: head/etc/rc.d/routing 179566 2008-06-05 17:26:47Z brooks $
6#
7
8# PROVIDE: routing
6#
7
8# PROVIDE: routing
9# REQUIRE: devd netif ppp
9# REQUIRE: netif ppp
10# KEYWORD: nojail
11
12. /etc/rc.subr
13. /etc/network.subr
14
15name="routing"
16start_cmd="routing_start"
17stop_cmd="routing_stop"
18extra_commands="options static"
19static_cmd="static_start"
20options_cmd="options_start"
21
22routing_start()
23{
24 static_start
25 options_start
10# KEYWORD: nojail
11
12. /etc/rc.subr
13. /etc/network.subr
14
15name="routing"
16start_cmd="routing_start"
17stop_cmd="routing_stop"
18extra_commands="options static"
19static_cmd="static_start"
20options_cmd="options_start"
21
22routing_start()
23{
24 static_start
25 options_start
26
27 # Return without waiting if we don't have dhcp interfaces.
28 # Once we can test that the link is actually up, we should
29 # remove this test and always wait.
30 dhcp_interfaces=`list_net_interfaces dhcp`
31 [ -z "`list_net_interfaces dhcp`" ] && return
32
33 # Wait for a default route
34 delay=${if_up_delay}
35 while [ ${delay} -gt 0 ]; do
36 defif=`get_default_if -inet`
37 if [ -n "${defif}" ]; then
38 if [ ${delay} -ne ${if_up_delay} ]; then
39 echo "($defif)"
40 fi
41 break
42 fi
43 if [ ${delay} -eq ${if_up_delay} ]; then
44 echo -n "Waiting ${delay}s for an interface to come up: "
45 else
46 echo -n .
47 fi
48 sleep 1
49 delay=`expr $delay - 1`
50 done
51}
52
53routing_stop()
54{
55 route -n flush
56}
57
58static_start()

--- 92 unchanged lines hidden ---
26}
27
28routing_stop()
29{
30 route -n flush
31}
32
33static_start()

--- 92 unchanged lines hidden ---