Deleted Added
full compact
rtadvd (124616) rtadvd (124622)
1#!/bin/sh
2#
3# $NetBSD: rtadvd,v 1.5 2002/03/22 04:34:00 thorpej Exp $
1#!/bin/sh
2#
3# $NetBSD: rtadvd,v 1.5 2002/03/22 04:34:00 thorpej Exp $
4# $FreeBSD: head/etc/rc.d/rtadvd 124616 2004-01-17 10:16:38Z mtm $
4# $FreeBSD: head/etc/rc.d/rtadvd 124622 2004-01-17 10:59:43Z mtm $
5#
6
7# PROVIDE: rtadvd
8# REQUIRE: DAEMON
9# BEFORE: LOGIN
10# KEYWORD: FreeBSD
11
12. /etc/rc.subr
13
14name="rtadvd"
15rcvar=`set_rcvar`
16command="/usr/sbin/${name}"
17start_precmd="rtadvd_precmd"
18
19rtadvd_precmd()
20{
5#
6
7# PROVIDE: rtadvd
8# REQUIRE: DAEMON
9# BEFORE: LOGIN
10# KEYWORD: FreeBSD
11
12. /etc/rc.subr
13
14name="rtadvd"
15rcvar=`set_rcvar`
16command="/usr/sbin/${name}"
17start_precmd="rtadvd_precmd"
18
19rtadvd_precmd()
20{
21 case ${OSTYPE} in
22 FreeBSD)
23 IS_GATEWAY="checkyesno ipv6_gateway_enable"
24 ;;
25 NetBSD)
26 IS_GATEWAY="eval [ \"$ip6mode\" = \"router\" ]"
27 ;;
28 esac
21 IS_GATEWAY="checkyesno ipv6_gateway_enable"
29 if ! ${IS_GATEWAY}; then
30 warn \
31 "${name} cannot be used on IPv6 host, only on an IPv6 router."
32 return 1
33 fi
34
35 # This should be enabled with a great care.
36 # You may want to fine-tune /etc/rtadvd.conf.
37 #
38 # And if you wish your rtadvd to receive and process
39 # router renumbering messages, specify your Router Renumbering
40 # security policy by -R option.
41 #
42 # See `man 3 ipsec_set_policy` for IPsec policy specification
43 # details.
44 # (CAUTION: This enables your routers prefix renumbering
45 # from another machine, so if you enable this, do it with
46 # enough care.)
47 #
22 if ! ${IS_GATEWAY}; then
23 warn \
24 "${name} cannot be used on IPv6 host, only on an IPv6 router."
25 return 1
26 fi
27
28 # This should be enabled with a great care.
29 # You may want to fine-tune /etc/rtadvd.conf.
30 #
31 # And if you wish your rtadvd to receive and process
32 # router renumbering messages, specify your Router Renumbering
33 # security policy by -R option.
34 #
35 # See `man 3 ipsec_set_policy` for IPsec policy specification
36 # details.
37 # (CAUTION: This enables your routers prefix renumbering
38 # from another machine, so if you enable this, do it with
39 # enough care.)
40 #
48 case ${OSTYPE} in
49 FreeBSD)
50 # If specific interfaces haven't been specified,
51 # get a list of interfaces and enable it on them
52 #
53 case ${rtadvd_interfaces} in
54 '')
55 for i in `ifconfig -l` ; do
56 case $i in
57 lo0|gif[0-9]*|stf[0-9]*|faith[0-9]*|lp[0-9]*|sl[0-9]*|tun[0-9]*)
58 continue
59 ;;
60 *)
61 rtadvd_interfaces="${rtadvd_interfaces} ${i}"
62 ;;
63 esac
64 done
65 ;;
66 esac
67 command_args="${rtadvd_interfaces}"
68
69 # Enable Router Renumbering, unicast case
70 # (use correct src/dst addr)
71 # rtadvd -R "in ipsec ah/transport/fec0:0:0:1::1-fec0:0:0:10::1/require" ${ipv6_network_interfaces}
72 # Enable Router Renumbering, multicast case
73 # (use correct src addr)
74 # rtadvd -R "in ipsec ah/transport/ff05::2-fec0:0:0:10::1/require" ${ipv6_network_interfaces}
41 # If specific interfaces haven't been specified,
42 # get a list of interfaces and enable it on them
43 #
44 case ${rtadvd_interfaces} in
45 '')
46 for i in `ifconfig -l` ; do
47 case $i in
48 lo0|gif[0-9]*|stf[0-9]*|faith[0-9]*|lp[0-9]*|sl[0-9]*|tun[0-9]*)
49 continue
50 ;;
51 *)
52 rtadvd_interfaces="${rtadvd_interfaces} ${i}"
53 ;;
54 esac
55 done
75 ;;
76 esac
56 ;;
57 esac
58 command_args="${rtadvd_interfaces}"
59
60 # Enable Router Renumbering, unicast case
61 # (use correct src/dst addr)
62 # rtadvd -R "in ipsec ah/transport/fec0:0:0:1::1-fec0:0:0:10::1/require" ${ipv6_network_interfaces}
63 # Enable Router Renumbering, multicast case
64 # (use correct src addr)
65 # rtadvd -R "in ipsec ah/transport/ff05::2-fec0:0:0:10::1/require" ${ipv6_network_interfaces}
77 return 0
78}
79
80load_rc_config $name
81run_rc_command "$1"
66 return 0
67}
68
69load_rc_config $name
70run_rc_command "$1"