blob: 7b825e1f0abe693e3c000be4393c55ac1ed58366 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
#!/bin/sh
DATE=`${WHICH} date`
# user id
tempfile=`${MKTEMP} -t ipv6pd`
${DIALOG} --title "L2TP-IPv6PD Setup Helper" --clear \
--inputbox "Please Input User ID:" -1 -1 2> ${tempfile}
retval=$?
case $retval in
0)
ppp_id=`${CAT} ${tempfile}`
${RM} ${tempfile}
;;
1)
${RM} ${tempfile}
exit
;;
255)
${RM} ${tempfile}
exit
;;
esac
# passwd
tempfile=`${MKTEMP} -t ipv6pd`
${DIALOG} --title "L2TP-IPv6PD Setup Helper" \
--inputbox "Please Input Passwd:" -1 -1 \
2> ${tempfile}
case $retval in
0)
ppp_passwd=`${CAT} ${tempfile}`
${RM} ${tempfile}
;;
1)
${RM} ${tempfile}
exit
;;
255)
${RM} ${tempfile}
exit
;;
esac
# fixed server
tempfile=`${MKTEMP} -t ipv6pd`
${DIALOG} --title "L2TP-IPv6PD Setup Helper" \
--inputbox "Please Input L2TP-IPv6PD Server\n(Fixed Prefix):" \
-1 -1 2> ${tempfile}
case $retval in
0)
fixed_server=`${CAT} ${tempfile}`
${RM} ${tempfile}
;;
1)
${RM} ${tempfile}
exit
;;
255)
${RM} ${tempfile}
exit
;;
esac
# Set PPP Interface
if [ "${MPD_NAME}" = "mpd4" ]; then
tempfile=`${MKTEMP} -t ipv6pd`
${DIALOG} --title "L2TP-IPv6PD Setup Helper" \
--inputbox "Please Input PPP Interface (default: ng0):" \
-1 -1 2> ${tempfile}
case $retval in
0)
interface=`${CAT} ${tempfile}`
if [ -z "${interface}" ]; then
interface="ng0"
fi
${RM} ${tempfile}
;;
1)
${RM} ${tempfile}
exit
;;
255)
${RM} ${tempfile}
exit
;;
esac
fi
# Set Prefix Delegation Interface
tempfile=`${MKTEMP} -t ipv6pd`
${DIALOG} --title "L2TP-IPv6PD Setup Helper" \
--inputbox "Please Input Prefix Delegation Interface:" -1 -1 \
2> ${tempfile}
case $retval in
0)
pd_interface=`${CAT} ${tempfile}`
${RM} ${tempfile}
;;
1)
${RM} ${tempfile}
exit
;;
255)
${RM} ${tempfile}
exit
;;
esac
for infile in ${SCRIPTDIR}/*.in; do
outfile=${WRKDIR}/`basename ${infile} .in`
${SED} -e "s|%%PPP_ID%%|${ppp_id}|g" \
-e "s|%%PPP_PASSWD%%|${ppp_passwd}|g" \
-e "s|%%FIXED_SERVER%%|${fixed_server}|g" \
-e "s|%%INTERFACE%%|${interface}|g" \
-e "s|%%PD_INTERFACE%%|${pd_interface}|g" \
-e "s|%%RC_SUBR%%|${RC_SUBR}|g" \
-e "s|%%PREFIX%%|${PREFIX}|g" \
-e "s|%%CONF_DIR%%|${CONF_DIR}|g" \
-e "s|%%MD5%%|${MD5}|g" \
-e "s|%%SED%%|${SED}|g" \
-e "s|%%DATE%%|${DATE}|g" \
< ${infile} > ${outfile}
done
outfile="${WRKDIR}/pkg-message"
cat <<EOF > ${outfile}
Type following commands to complete setup:
# mkdir /etc/rc.conf.d
# cp ${PREFIX}/${CONF_DIR}/${MPD_NAME} /etc/rc.conf.d/${MPD_NAME}
If you are not using 6.3-RELEASE nor later, apply following patch and
rebuild your kernel:
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netgraph/ng_ksocket.c.diff?r1=1.59&r2=1.60
EOF
|