Lines 52-58
Link Here
|
52 |
local i iface="${1//\./_}" |
52 |
local i iface="${1//\./_}" |
53 |
|
53 |
|
54 |
status_IFACE="$(ifconfig ${1} 2>${devnull} | gawk '$1 == "UP" {print "up"}')" |
54 |
status_IFACE="$(ifconfig ${1} 2>${devnull} | gawk '$1 == "UP" {print "up"}')" |
|
|
55 |
status_TUNNEL="$(/sbin/iptunnel show ${1})" |
55 |
eval vlans_IFACE=\"\$\{iface_${iface}_vlans\}\" |
56 |
eval vlans_IFACE=\"\$\{iface_${iface}_vlans\}\" |
|
|
57 |
eval tunnel_IFACE=\"$\{tunnel_${iface}\}\" |
56 |
eval ifconfig_IFACE=( \"\$\{ifconfig_$iface\[@\]\}\" ) |
58 |
eval ifconfig_IFACE=( \"\$\{ifconfig_$iface\[@\]\}\" ) |
57 |
eval dhcpcd_IFACE=\"\$\{dhcpcd_$iface\}\" |
59 |
eval dhcpcd_IFACE=\"\$\{dhcpcd_$iface\}\" |
58 |
eval routes_IFACE=( \"\$\{routes_$iface\[@\]\}\" ) |
60 |
eval routes_IFACE=( \"\$\{routes_$iface\[@\]\}\" ) |
Lines 88-93
Link Here
|
88 |
local IFACE=${1} i x retval |
90 |
local IFACE=${1} i x retval |
89 |
checkconfig || return 1 |
91 |
checkconfig || return 1 |
90 |
|
92 |
|
|
|
93 |
# Tunnel configuration detected; run iptunnel |
94 |
if [[ -z ${status_TUNNEL} && -n ${tunnel_IFACE} ]]; then |
95 |
ebegin "Configuring tunnel ${IFACE}" |
96 |
/sbin/iptunnel add ${IFACE} ${tunnel_IFACE} |
97 |
eend 0 |
98 |
fi |
99 |
|
91 |
if [[ ${ifconfig_IFACE} != dhcp ]]; then |
100 |
if [[ ${ifconfig_IFACE} != dhcp ]]; then |
92 |
# Show the address, but catch if this interface will be inet6 only |
101 |
# Show the address, but catch if this interface will be inet6 only |
93 |
i=${ifconfig_IFACE%% *} |
102 |
i=${ifconfig_IFACE%% *} |
Lines 214-219
Link Here
|
214 |
ebegin "Bringing ${IFACE} down" |
223 |
ebegin "Bringing ${IFACE} down" |
215 |
ifconfig ${IFACE} down &>/dev/null |
224 |
ifconfig ${IFACE} down &>/dev/null |
216 |
eend 0 |
225 |
eend 0 |
|
|
226 |
|
227 |
# Try to tear down tunnel |
228 |
# setup_vars doesn't get to run, build status_TUNNEL |
229 |
status_TUNNEL="$(/sbin/iptunnel show ${IFACE})" |
230 |
if [[ -n ${status_TUNNEL} ]]; then |
231 |
ebegin "Destroying tunnel ${IFACE}" |
232 |
/sbin/iptunnel del ${IFACE} |
233 |
eend |
234 |
fi |
235 |
|
217 |
return 0 |
236 |
return 0 |
218 |
fi |
237 |
fi |
219 |
|
238 |
|
Lines 252-257
Link Here
|
252 |
eend 0 |
271 |
eend 0 |
253 |
done |
272 |
done |
254 |
|
273 |
|
|
|
274 |
# Try to tear down tunnel |
275 |
# setup_vars doesn't get to run, build status_TUNNEL |
276 |
status_TUNNEL="$(/sbin/iptunnel show ${IFACE})" |
277 |
if [[ -n ${status_TUNNEL} ]]; then |
278 |
ebegin "Destroying tunnel ${IFACE}" |
279 |
/sbin/iptunnel del ${IFACE} |
280 |
eend |
281 |
fi |
282 |
|
255 |
return 0 |
283 |
return 0 |
256 |
} |
284 |
} |
257 |
|
285 |
|